]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agoMerge pull request #5917 from Spantik/ospf_redis
Russ White [Wed, 8 Apr 2020 13:35:56 +0000 (09:35 -0400)]
Merge pull request #5917 from Spantik/ospf_redis

Zebra: Default route distribute handling.

4 years agoMerge pull request #6166 from volta-networks/fix_isis_lsp_timers
Olivier Dugeon [Wed, 8 Apr 2020 08:00:03 +0000 (10:00 +0200)]
Merge pull request #6166 from volta-networks/fix_isis_lsp_timers

isisd, yang: unified lsp-timers command

4 years agoMerge pull request #6180 from mjstapp/fix_bgp_ecomm_sa
Renato Westphal [Wed, 8 Apr 2020 02:00:06 +0000 (23:00 -0300)]
Merge pull request #6180 from mjstapp/fix_bgp_ecomm_sa

bgpd: clean up SA warning in bgp_ecommunity.c

4 years agoMerge pull request #6174 from volta-networks/fix_lm_async_log
Renato Westphal [Wed, 8 Apr 2020 01:59:09 +0000 (22:59 -0300)]
Merge pull request #6174 from volta-networks/fix_lm_async_log

zebra: minor fix to label manager log

4 years agoMerge pull request #6183 from qlyoung/doc-isis-lsp-mtu-knob
Renato Westphal [Wed, 8 Apr 2020 01:44:42 +0000 (22:44 -0300)]
Merge pull request #6183 from qlyoung/doc-isis-lsp-mtu-knob

doc: document lsp-mtu knob for IS-IS

4 years agodoc: document lsp-mtu knob for IS-IS
Quentin Young [Wed, 8 Apr 2020 00:11:18 +0000 (20:11 -0400)]
doc: document lsp-mtu knob for IS-IS

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoZebra: Default route distribute handling.
Santosh P K [Tue, 7 Apr 2020 14:02:21 +0000 (07:02 -0700)]
Zebra: Default route distribute handling.

When default route is requested from client, default
route is sent to client if present. When route gets
deleted then delete is sent to clients.

Signed-off-by: Santosh P K <sapk@vmware.com>
4 years agoMerge pull request #6178 from opensourcerouting/debian-backprop
Quentin Young [Tue, 7 Apr 2020 17:03:21 +0000 (13:03 -0400)]
Merge pull request #6178 from opensourcerouting/debian-backprop

feed debian/ changes back into master

4 years agobgpd: clean up SA warning in bgp_ecommunity.c
Mark Stapp [Tue, 7 Apr 2020 16:56:43 +0000 (12:56 -0400)]
bgpd: clean up SA warning in bgp_ecommunity.c

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #6179 from ton31337/fix/typecast_to_biger_sizes
Quentin Young [Tue, 7 Apr 2020 16:42:38 +0000 (12:42 -0400)]
Merge pull request #6179 from ton31337/fix/typecast_to_biger_sizes

tools: Add coccinelle script to catch typecasts to larger sizes

4 years agoMerge pull request #6097 from mjstapp/fix_nhg_cli_dups
Stephen Worley [Tue, 7 Apr 2020 16:14:44 +0000 (12:14 -0400)]
Merge pull request #6097 from mjstapp/fix_nhg_cli_dups

lib: support replacement in the nexthop-group cli

4 years agoMerge pull request #6173 from ton31337/fix/treat-as-withdraw_community
Russ White [Tue, 7 Apr 2020 15:42:01 +0000 (11:42 -0400)]
Merge pull request #6173 from ton31337/fix/treat-as-withdraw_community

bgpd: Treat-as-withdraw if [el]community length is zero

4 years agotools: Add coccinelle script to catch typecasts to larger sizes
Donatas Abraitis [Tue, 7 Apr 2020 14:25:10 +0000 (17:25 +0300)]
tools: Add coccinelle script to catch typecasts to larger sizes

That's valid only for uint*_t

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agodebian: 7.2.1 prep
David Lamparter [Mon, 20 Jan 2020 15:57:10 +0000 (16:57 +0100)]
debian: 7.2.1 prep

Just the odd housekeeping bits.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agodebian: remove outdated README content
David Lamparter [Mon, 20 Jan 2020 15:53:55 +0000 (16:53 +0100)]
debian: remove outdated README content

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agolib: support replacement in the nexthop-group cli
Mark Stapp [Thu, 26 Mar 2020 18:11:56 +0000 (14:11 -0400)]
lib: support replacement in the nexthop-group cli

Use more limited matching logic so that nexthops within a
nexthop-group are unique based only on vrf, type, and gateway.
Treat configuration of a nexthop that matches an existing
nexthop as a replace operation.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agozebra: minor fix to label manager log
Emanuele Di Pascale [Thu, 2 Apr 2020 22:05:44 +0000 (00:05 +0200)]
zebra: minor fix to label manager log

zebra should only check whether a get_chunk operation succeeded
when processing the response, rather than insde the get_chunk
call itself. Spllitting the request and response hooks was done
precisely to allow for asynchronous calls to an external label
manager; in this case, the requested chunk is not necessarily
going to be available at request time.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agobgpd: Treat-as-withdraw if [el]community length is zero
Donatas Abraitis [Tue, 7 Apr 2020 07:08:16 +0000 (10:08 +0300)]
bgpd: Treat-as-withdraw if [el]community length is zero

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6167 from qlyoung/fix-cluster-list-uaf
Donatas Abraitis [Tue, 7 Apr 2020 06:47:28 +0000 (09:47 +0300)]
Merge pull request #6167 from qlyoung/fix-cluster-list-uaf

bgpd: treat 0-length cluster_list as withdraw

4 years agoMerge pull request #6160 from qlyoung/fix-pim-bsm-negative-shift
David Lamparter [Mon, 6 Apr 2020 18:26:13 +0000 (20:26 +0200)]
Merge pull request #6160 from qlyoung/fix-pim-bsm-negative-shift

pimd: fix negative bitshift in BSM code

4 years agobgpd: treat 0-length cluster_list as withdraw
Quentin Young [Mon, 6 Apr 2020 16:30:35 +0000 (12:30 -0400)]
bgpd: treat 0-length cluster_list as withdraw

See source comment...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agopimd: fix negative bitshift
Quentin Young [Mon, 6 Apr 2020 03:40:47 +0000 (23:40 -0400)]
pimd: fix negative bitshift

Valid range for hashmasklen is 0-32 under IPv4; failure to validate this
results in a negative bitshift later

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #6150 from ton31337/feature/black_topotests_developer_guide
David Lamparter [Mon, 6 Apr 2020 15:39:20 +0000 (17:39 +0200)]
Merge pull request #6150 from ton31337/feature/black_topotests_developer_guide

doc: Mention that we should use `black` code formatter for topotests

4 years agoisisd, yang: unified lsp-timers command
Emanuele Di Pascale [Mon, 6 Apr 2020 15:05:41 +0000 (17:05 +0200)]
isisd, yang: unified lsp-timers command

Yang constraints enforced by the northbound callbacks require that
the maximum lifetime be >= than (refresh interval + 300). When we are
moving from one config to another through frr-reload.py, we issue
a number of vtysh -c commands ('no lsp-refresh-interval level-1 500',
'no max-lsp-lifetime level-1 1000'), which reset these parameters to their
default values, respectively 900 and 1200. Depending on the actual
values in the current config, the order in which these commands are sent
might be the wrong one, in that we hit an invalid intermediate state and
make vtysh (and by extension frr-reload.py) return an error.

As a workaround, let's add a one-liner command that sets all these
inter-related parameters in one go, and make isisd display them as a
single line too, so that the diff will be computed as a single command.
The old individual commands are kept to ensure backwards compatibility.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agoMerge pull request #6158 from qlyoung/fix-cluster-list-uaf
David Lamparter [Mon, 6 Apr 2020 15:38:27 +0000 (17:38 +0200)]
Merge pull request #6158 from qlyoung/fix-cluster-list-uaf

bgpd: fix multiple bugs with cluster_list attrs

4 years agoMerge pull request #6155 from qlyoung/fix-unsigned-cmp-lt-zero
David Lamparter [Mon, 6 Apr 2020 15:37:11 +0000 (17:37 +0200)]
Merge pull request #6155 from qlyoung/fix-unsigned-cmp-lt-zero

bgpd, zebra: don't compare unsigned < 0

4 years agoMerge pull request #6159 from qlyoung/fix-pim-tlv-unaligned-pointer-access
David Lamparter [Mon, 6 Apr 2020 15:33:01 +0000 (17:33 +0200)]
Merge pull request #6159 from qlyoung/fix-pim-tlv-unaligned-pointer-access

pimd: fix unaligned pointer access

4 years agoMerge pull request #6161 from qlyoung/fix-bsm-json-keys
Donatas Abraitis [Mon, 6 Apr 2020 07:37:32 +0000 (10:37 +0300)]
Merge pull request #6161 from qlyoung/fix-bsm-json-keys

pimd: fix BSM JSON keys

4 years agopimd: fix unaligned access parsing tlvs
Quentin Young [Mon, 6 Apr 2020 04:14:14 +0000 (00:14 -0400)]
pimd: fix unaligned access parsing tlvs

Can't use a uint8_t as a uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agopimd: fix BSM JSON keys
Quentin Young [Mon, 6 Apr 2020 03:53:02 +0000 (23:53 -0400)]
pimd: fix BSM JSON keys

We use camelCase keys in FRR.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agobgpd: fix multiple bugs with cluster_list attrs
Quentin Young [Sun, 5 Apr 2020 21:11:25 +0000 (17:11 -0400)]
bgpd: fix multiple bugs with cluster_list attrs

Multiple different issues causing mostly UAFs but maybe other more
subtle things.

- Cluster lists were the only attributes whose pointers were not being
  NULL'd when freed, resulting in heap UAF
- When performing an insert into the cluster hash, our temporary struct
  used for hash_get() was inconsistent with our hash keying and
  comparison functions. In the case of a zero length cluster list, the
  ->length field is 0 and the ->list field is NULL. When performing an
  insert, we set the ->list field regardless of whether the length is 0.
  This resulted in the two cluster lists hashing equal but not comparing
  equal. Later, when removing one of them from the hash before freeing
  it, because the key matched and the comparison succeeded (because it
  was set to NULL *after* the search but *before* inserting into the
  hash) we would sometimes release the duplicated copy of the struct,
  and then free the one that remained in the hash table. Later accesses
  constitute UAF. This is fixed by making sure the fields used for the
  existence check match what is actually inserted into the hash when
  that check fails.

This patch also makes cluster_unintern static, because it should be.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #6105 from vivek-cumulus/bgp_link_bandwidth_unequal_cost_multipath
Sri Mohana Singamsetty [Sun, 5 Apr 2020 18:41:42 +0000 (11:41 -0700)]
Merge pull request #6105 from vivek-cumulus/bgp_link_bandwidth_unequal_cost_multipath

Unequal cost multipath (a.ka. weighted ECMP) with BGP link-bandwidth

4 years agoMerge pull request #6143 from ton31337/fix/remove_prefixReceivedCount
Sri Mohana Singamsetty [Sun, 5 Apr 2020 18:41:04 +0000 (11:41 -0700)]
Merge pull request #6143 from ton31337/fix/remove_prefixReceivedCount

bgpd: Remove `prefixReceivedCount` from JSON

4 years agoMerge pull request #6144 from ton31337/fix/python_formatter
Quentin Young [Sun, 5 Apr 2020 17:20:30 +0000 (13:20 -0400)]
Merge pull request #6144 from ton31337/fix/python_formatter

tests: Run python formatter (black) for topotests

4 years agoMerge pull request #6153 from opensourcerouting/nb-stuff
Quentin Young [Sun, 5 Apr 2020 17:19:22 +0000 (13:19 -0400)]
Merge pull request #6153 from opensourcerouting/nb-stuff

Minor NB improvements

4 years agodoc: Mention that we should use `black` code formatter for topotests
Donatas Abraitis [Fri, 3 Apr 2020 19:26:19 +0000 (22:26 +0300)]
doc: Mention that we should use `black` code formatter for topotests

black - https://github.com/psf/black

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6134 from taspelund/unlink_warning
Donatas Abraitis [Sun, 5 Apr 2020 15:52:08 +0000 (18:52 +0300)]
Merge pull request #6134 from taspelund/unlink_warning

vtysh: don't warn when saving conf the first time

4 years agoMerge pull request #6156 from qlyoung/fix-bgp-null-memcp-again
Donatas Abraitis [Sun, 5 Apr 2020 07:53:23 +0000 (10:53 +0300)]
Merge pull request #6156 from qlyoung/fix-bgp-null-memcp-again

bgpd: fix memcmp(null, *) when parsing bgp attrs

4 years agobgpd: fix memcmp(null, *) when parsing bgp attrs
Quentin Young [Sun, 5 Apr 2020 05:02:42 +0000 (01:02 -0400)]
bgpd: fix memcmp(null, *) when parsing bgp attrs

My first patch for this only fixed the memcmp(NULL, NULL) case.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agobgpd, zebra: don't compare unsigned < 0
Quentin Young [Sun, 5 Apr 2020 03:26:19 +0000 (23:26 -0400)]
bgpd, zebra: don't compare unsigned < 0

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #6146 from AnuradhaKaruppiah/evpn-null-fix
Sri Mohana Singamsetty [Sat, 4 Apr 2020 03:57:42 +0000 (20:57 -0700)]
Merge pull request #6146 from AnuradhaKaruppiah/evpn-null-fix

zebra: fix NULL deref reported by coverity in evpn-pim cleanup

4 years agolib: consolidate flexible array hack in a single place
Renato Westphal [Fri, 3 Apr 2020 23:10:04 +0000 (20:10 -0300)]
lib: consolidate flexible array hack in a single place

Old gcc versions (< 5.x) have a bug that prevents C99 flexible
arrays from working properly on shared libraries.

We already have a hack in place to work around this problem, but it
needs to be replicated in every declaration of a frr_yang_module_info
variable within libfrr. This clearly isn't a good solution if we
consider that many more libfrr YANG modules are about to come in
the future.

This commit introduces a different workaround that operates within
the northbound layer itself, such that implementers of libfrr YANG
modules won't need to worry about this problem anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib, tools: silence harmless warnings in the northbound tools
Renato Westphal [Fri, 3 Apr 2020 22:43:02 +0000 (19:43 -0300)]
lib, tools: silence harmless warnings in the northbound tools

Our two northbound tools don't have embedded YANG modules like the
other FRR binaries. As such, ly_ctx_set_module_imp_clb() shouldn't be
called when the YANG subsystem it being initialized by a northbound
tool. To make that possible, add a new "embedded_modules" parameter
to the yang_init() function to control whether libyang should look
for embedded modules or not.

With this fix, "gen_northbound_callbacks" and "gen_yang_deviations"
won't emit "YANG model X not embedded, trying external file"
warnings anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoMerge pull request #6149 from Spantik/route-map-yang
Donald Sharp [Fri, 3 Apr 2020 22:32:29 +0000 (18:32 -0400)]
Merge pull request #6149 from Spantik/route-map-yang

lib: [YANG] Route-map inteface forward ref

4 years agolib: [YANG] Route-map inteface forward ref
Santosh P K [Fri, 3 Apr 2020 19:15:20 +0000 (12:15 -0700)]
lib: [YANG] Route-map inteface forward ref

To satisfy forward reference for interface in route-map.
Libyang 0.16 does not support leafref yet.

Signed-off-by: Santosh P K <sapk@vmware.com>
4 years agotests: Run python formatter (black) for topotests
reformat [Fri, 3 Apr 2020 11:05:24 +0000 (14:05 +0300)]
tests: Run python formatter (black) for topotests

Mostly ' => ", whitespace changes.

Using https://github.com/psf/black

Signed-off-by: reformat <reformat@nobody.nobody>
4 years agoMerge pull request #6071 from ton31337/feature/rfc6286
David Lamparter [Fri, 3 Apr 2020 13:16:59 +0000 (15:16 +0200)]
Merge pull request #6071 from ton31337/feature/rfc6286

bgpd: Add support for Autonomous-System-Wide Unique BGP Identifier

4 years agobgpd: Remove `prefixReceivedCount` from JSON
Donatas Abraitis [Fri, 3 Apr 2020 13:16:06 +0000 (16:16 +0300)]
bgpd: Remove `prefixReceivedCount` from JSON

This is already covered by pfxRcd. Removed due to consistency
between CLI and JSON.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agotests: Replace prefixReceivedCount to pfxRcd in JSONs
Donatas Abraitis [Fri, 3 Apr 2020 13:15:55 +0000 (16:15 +0300)]
tests: Replace prefixReceivedCount to pfxRcd in JSONs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agozebra: fix NULL deref reported by coverity in evpn-pim cleanup
Anuradha Karuppiah [Fri, 3 Apr 2020 12:56:27 +0000 (05:56 -0700)]
zebra: fix NULL deref reported by coverity in evpn-pim cleanup

*** CID 1492481:  Null pointer dereferences  (NULL_RETURNS)
/zebra/zebra_vxlan.c: 10262 in zebra_evpn_pim_cfg_clean_up()
10256     }
10257
10258     static int zebra_evpn_pim_cfg_clean_up(struct zserv *client)
10259     {
10260      struct zebra_vrf *zvrf = zebra_vrf_get_evpn();
10261
>>>     CID 1492481:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "zvrf", which is known to be "NULL".
10262      if (CHECK_FLAG(zvrf->flags, ZEBRA_PIM_SEND_VXLAN_SG)) {
10263      if (IS_ZEBRA_DEBUG_VXLAN)
10264      zlog_debug("VxLAN SG updates to PIM, stop");
10265      UNSET_FLAG(zvrf->flags, ZEBRA_PIM_SEND_VXLAN_SG);
10266      }

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
4 years agoMerge pull request #6138 from donaldsharp/rtadv_respect_the_vrf
David Lamparter [Fri, 3 Apr 2020 12:04:43 +0000 (14:04 +0200)]
Merge pull request #6138 from donaldsharp/rtadv_respect_the_vrf

Rtadv respect the vrf

4 years agovtysh: don't warn when saving conf the first time
Trey Aspelund [Wed, 1 Apr 2020 23:59:32 +0000 (19:59 -0400)]
vtysh: don't warn when saving conf the first time

This removes a warning when ENOENT is returned while backing up the
config. This also provides strerror when backup fails for other reasons.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
4 years agoMerge pull request #6130 from ton31337/fix/remove_some_redundant_attributes_from_json
Sri Mohana Singamsetty [Thu, 2 Apr 2020 23:17:24 +0000 (16:17 -0700)]
Merge pull request #6130 from ton31337/fix/remove_some_redundant_attributes_from_json

bgpd: Remove deprecated JSON fields for `show bgp ... json`

4 years agoMerge pull request #6141 from opensourcerouting/defaults-fix-bools
Donald Sharp [Thu, 2 Apr 2020 22:49:34 +0000 (18:49 -0400)]
Merge pull request #6141 from opensourcerouting/defaults-fix-bools

bgpd, ospfd, ospf6d: long is not bool :(

4 years agobgpd, ospfd, ospf6d: long is not bool :(
David Lamparter [Thu, 2 Apr 2020 19:16:04 +0000 (21:16 +0200)]
bgpd, ospfd, ospf6d: long is not bool :(

... Oops ...

(for context, the defaults code originally didn't have a dedicated
"bool" variant and just used long for bools...  I derp'd this when
adding bool as a separate case :( )

Reported-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoMerge pull request #6133 from sworleys/NHG-Fix-Dup-Leak
Mark Stapp [Thu, 2 Apr 2020 17:18:30 +0000 (13:18 -0400)]
Merge pull request #6133 from sworleys/NHG-Fix-Dup-Leak

zebra: free unhashable (dup) NHEs via ID table cleanup

4 years agozebra: free unhashable (dup) NHEs via ID table cleanup
Stephen Worley [Wed, 1 Apr 2020 19:31:40 +0000 (15:31 -0400)]
zebra: free unhashable (dup) NHEs via ID table cleanup

Free unhashable (duplicate NHEs from the kernel) via ID table
cleanup. Since the NHE ID hash table contains extra entries,
that's the one we need to be calling zebra_nhg_hash_free()
on, otherwise we will never free the unhashable NHEs.

This was found via a memleak:

==1478713== HEAP SUMMARY:
==1478713==     in use at exit: 10,267 bytes in 46 blocks
==1478713==   total heap usage: 76,810 allocs, 76,764 frees, 3,901,237 bytes allocated
==1478713==
==1478713== 208 (88 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 35 of 41
==1478713==    at 0x483BB1A: calloc (vg_replace_malloc.c:762)
==1478713==    by 0x48E35E8: qcalloc (memory.c:110)
==1478713==    by 0x451CCB: zebra_nhg_alloc (zebra_nhg.c:369)
==1478713==    by 0x453DE3: zebra_nhg_copy (zebra_nhg.c:379)
==1478713==    by 0x452670: nhg_ctx_process_new (zebra_nhg.c:1143)
==1478713==    by 0x4523A8: nhg_ctx_process (zebra_nhg.c:1234)
==1478713==    by 0x452A2D: zebra_nhg_kernel_find (zebra_nhg.c:1294)
==1478713==    by 0x4326E0: netlink_nexthop_change (rt_netlink.c:2433)
==1478713==    by 0x427320: netlink_parse_info (kernel_netlink.c:945)
==1478713==    by 0x432DAD: netlink_nexthop_read (rt_netlink.c:2488)
==1478713==    by 0x41B600: interface_list (if_netlink.c:1486)
==1478713==    by 0x457275: zebra_ns_enable (zebra_ns.c:127)

Repro with:
ip next add id 1 blackhole
ip next add id 2 blackhole

valgrind /usr/lib/frr/zebra

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Add some vrf information to RA logs
Donald Sharp [Thu, 2 Apr 2020 15:33:35 +0000 (11:33 -0400)]
zebra: Add some vrf information to RA logs

Add some data about what vrf we are operating on
in the RA logs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Don't kill the global rtadv socket when a vrf is deleted
Donald Sharp [Thu, 2 Apr 2020 15:16:50 +0000 (11:16 -0400)]
zebra: Don't kill the global rtadv socket when a vrf is deleted

The rtadv code has two types of sockets:
a) namespace -> Where each zvrf get's it's own socket
b) vrf lite -> Where we get 1 socket for everything

When we were terminating a vrf we were *always*
killing the (b) socket.  This is a mistake in
that other vrf's may need to be communicating.

Modify the code on vrf shutdown to only disable
that vrf's event processing and when we actually
terminate we shut the socket.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6132 from qlyoung/fix-bgp-vnc-ifdef
Sri Mohana Singamsetty [Thu, 2 Apr 2020 02:35:13 +0000 (19:35 -0700)]
Merge pull request #6132 from qlyoung/fix-bgp-vnc-ifdef

bgpd: #if ENABLE_BGP_VNC -> #ifdef ENABLE_BGP_VNC

4 years agoMerge pull request #6131 from qlyoung/doc-json-camelcase
Renato Westphal [Wed, 1 Apr 2020 22:52:15 +0000 (19:52 -0300)]
Merge pull request #6131 from qlyoung/doc-json-camelcase

doc: document JSON conventions

4 years agoMerge pull request #6109 from volta-networks/feat_ldp_host_only
Renato Westphal [Wed, 1 Apr 2020 22:51:22 +0000 (19:51 -0300)]
Merge pull request #6109 from volta-networks/feat_ldp_host_only

ldpd:  host only filter

4 years agotests: Remove/change JSON attributes for `show bgp ... json`
Donatas Abraitis [Wed, 1 Apr 2020 14:04:08 +0000 (17:04 +0300)]
tests: Remove/change JSON attributes for `show bgp ... json`

This is related to some attributes changes: aspath, med, localPref.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: #if ENABLE_BGP_VNC -> #ifdef ENABLE_BGP_VNC
Quentin Young [Wed, 1 Apr 2020 19:05:26 +0000 (15:05 -0400)]
bgpd: #if ENABLE_BGP_VNC -> #ifdef ENABLE_BGP_VNC

This macro is undefined if vnc is disabled, and while it defaults to 0,
this is still wrong and causes issues with -Werror

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoldpd: fixing host-only configuration filter.
lynne [Sun, 29 Mar 2020 17:47:36 +0000 (13:47 -0400)]
ldpd: fixing host-only configuration filter.

There is configuration in LDP to only create labels for
host-routes.   If the user remove this configuration the code
was not readvertising non-host routes to it's LDP neighbors.
The issue is the same in reverse also.  If the user adds this
configuration on an active LDP session the non-host routes were
not withdrawn.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
4 years agodoc: document JSON conventions
Quentin Young [Wed, 1 Apr 2020 16:37:43 +0000 (12:37 -0400)]
doc: document JSON conventions

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agobgpd: Remove deprecated JSON fields for `show bgp ... json`
Donatas Abraitis [Wed, 1 Apr 2020 14:02:30 +0000 (17:02 +0300)]
bgpd: Remove deprecated JSON fields for `show bgp ... json`

med --------> metric
localPref --> locPrf
aspath -----> path

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6120 from donaldsharp/ospf6_const
David Lamparter [Wed, 1 Apr 2020 12:10:26 +0000 (14:10 +0200)]
Merge pull request #6120 from donaldsharp/ospf6_const

ospf6d: Recent changes in our build cause const to be respected

4 years agoospf6d: Recent changes in our build cause const to be respected
Donald Sharp [Tue, 31 Mar 2020 11:55:17 +0000 (07:55 -0400)]
ospf6d: Recent changes in our build cause const to be respected

We are seeing this crash:

New LWP 7673]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/frr/ospf6d -d -F datacenter -M snmp -A ::1'.
Program terminated with signal SIGABRT, Aborted.
(gdb) bt
    vtysh=vtysh@entry=0) at lib/command.c:1288
(gdb)

The command entered is `debug ospf6 lsa inter-router examin`.  Code
inspection leads us to the fact that FRR is declaring the data as
const but we are attempting to modify it, causing the crash.

Remvoe the const of this set/get and let things work.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6122 from donaldsharp/more_cbit_fun
Donatas Abraitis [Wed, 1 Apr 2020 09:39:41 +0000 (12:39 +0300)]
Merge pull request #6122 from donaldsharp/more_cbit_fun

tests: More cbit extensions

4 years agotests: More cbit extensions
Donald Sharp [Tue, 31 Mar 2020 22:38:01 +0000 (18:38 -0400)]
tests: More cbit extensions

We are still seeing cbit test failures in the ci system.  I am
gonna try extending the timeout a bit more as that 8 seconds
doesn't seem to be long enough.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agotests: adding LDP tests for advertising host-routes.
lynne [Sun, 29 Mar 2020 17:43:05 +0000 (13:43 -0400)]
tests: adding LDP tests for advertising host-routes.

Adding test to verify that proper LDP labels are advertised if
host-route configuration is changed.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
4 years agoMerge pull request #6121 from ton31337/fix/typo_collision_function
Quentin Young [Tue, 31 Mar 2020 18:21:40 +0000 (14:21 -0400)]
Merge pull request #6121 from ton31337/fix/typo_collision_function

bgpd: Correct two comments typos for bgp_collision_detect()

4 years agoMerge pull request #5183 from opensourcerouting/zebra-route-map-nb
Quentin Young [Tue, 31 Mar 2020 18:21:20 +0000 (14:21 -0400)]
Merge pull request #5183 from opensourcerouting/zebra-route-map-nb

yang/zebra: migrate route map to northbound

4 years agobgpd: Correct two comments typos for bgp_collision_detect()
Donatas Abraitis [Tue, 31 Mar 2020 14:54:40 +0000 (17:54 +0300)]
bgpd: Correct two comments typos for bgp_collision_detect()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Add support for Autonomous-System-Wide Unique BGP Identifier
Donatas Abraitis [Sun, 22 Mar 2020 20:22:47 +0000 (22:22 +0200)]
bgpd: Add support for Autonomous-System-Wide Unique BGP Identifier

Implement https://tools.ietf.org/html/rfc6286

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5967 from rubenk/build-enable-wundef
David Lamparter [Tue, 31 Mar 2020 13:15:08 +0000 (15:15 +0200)]
Merge pull request #5967 from rubenk/build-enable-wundef

build: enable -Wundef warnings

4 years agoMerge pull request #6093 from LabNConsulting/working/lb/no-birds
David Lamparter [Tue, 31 Mar 2020 13:10:17 +0000 (15:10 +0200)]
Merge pull request #6093 from LabNConsulting/working/lb/no-birds

*: use the current project name (FRRouting)

4 years agoMerge pull request #6118 from qlyoung/display-ibuf-count
Donatas Abraitis [Tue, 31 Mar 2020 06:19:08 +0000 (09:19 +0300)]
Merge pull request #6118 from qlyoung/display-ibuf-count

bgpd: display ingress packet queue size

4 years agotests: topotests fixup for weight display
Donald Sharp [Mon, 30 Mar 2020 12:13:35 +0000 (08:13 -0400)]
tests: topotests fixup for weight display

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agotests: Add tests for BGP link-bandwidth and weighted ECMP
vivek [Sat, 28 Mar 2020 19:15:01 +0000 (12:15 -0700)]
tests: Add tests for BGP link-bandwidth and weighted ECMP

Implement tests to verify BGP link-bandwidth and weighted ECMP
functionality. These tests validate one of the primary use cases for
weighted ECMP (a.k.a. Unequal cost multipath) using BGP link-bandwidth:
https://tools.ietf.org/html/draft-mohanty-bess-ebgp-dmz

The included tests are:
Test #1: Test BGP link-bandwidth advertisement based on number of multipaths
Test #2: Test cumulative link-bandwidth propagation
Test #3: Test weighted ECMP - multipath with next hop weights
Test #4: Test weighted ECMP rebalancing upon change (link flap)
Test #5: Test weighted ECMP for a second anycast IP
Test #6: Test paths with and without link-bandwidth - receiver should resort to regular ECMP
Test #7: Test different options for processing link-bandwidth on the receiver

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agobgpd: Ensure RMAC extended community is unique
vivek [Tue, 24 Mar 2020 22:00:56 +0000 (15:00 -0700)]
bgpd: Ensure RMAC extended community is unique

The BGP Router MAC extended community should be unique and not occur
multiple times. In a VRF-to-VRF route-leak scenario where EVPN routes
from a source VRF are leaked into the target VRF and then injected
back into EVPN from the target VRF, the resulting route had more than
one RMAC. With this fix, the resulting route will have only the
target VRF's RMAC.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agobgpd: Allow generating EVPN type-5 routes with existing extended community
vivek [Tue, 24 Mar 2020 21:58:42 +0000 (14:58 -0700)]
bgpd: Allow generating EVPN type-5 routes with existing extended community

The EVPN advertise route-map may generate extended communities for an IPv4
or IPv6 route injected into EVPN as type-5. If so, allow for it and add
to it.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Display next hop's weight (if any) in route brief output
vivek [Tue, 24 Mar 2020 21:44:07 +0000 (14:44 -0700)]
zebra: Display next hop's weight (if any) in route brief output

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agobgpd: Add support for non-transitive link-bandwidth
vivek [Tue, 24 Mar 2020 21:41:52 +0000 (14:41 -0700)]
bgpd: Add support for non-transitive link-bandwidth

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agozebra: Display next hop weight via JSON key
vivek [Tue, 24 Mar 2020 21:40:09 +0000 (14:40 -0700)]
zebra: Display next hop weight via JSON key

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agobgpd: Implement options for link bandwidth handling
vivek [Tue, 24 Mar 2020 21:38:37 +0000 (14:38 -0700)]
bgpd: Implement options for link bandwidth handling

Support configurable options to control how link bandwidth is handled
by the receiver. The default behavior is to automatically honor the
link bandwidths received and use it to perform a weighted ECMP BUT only
if all paths in the multipath have associated link bandwidth; if one or
more paths do not have link bandwidth, normal ECMP is performed among
the multipaths. This behavior is as recommended by
https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth.

The additional options available are to (a) completely ignore any link
bandwidth (i.e., weighted ECMP is effectively disabled), (b) skip paths
in the multipath which do not have link bandwidth and perform weighted
ECMP among the other paths (if at least some paths have the bandwidth)
or (c) use a default weight (value chosen is 1) for the paths which
do not have link bandwidth.

The command syntax is
bgp bestpath bandwidth <ignore|skip-missing|default-weight-for-missing>

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agobgpd: Announce cumulative link bandwidth to EBGP peers
vivek [Tue, 24 Mar 2020 21:25:56 +0000 (14:25 -0700)]
bgpd: Announce cumulative link bandwidth to EBGP peers

When announcing ourselves as the next hop (e.g., to EBGP peers), if the
best path has the link bandwidth extended community and it is transitive,
change the value of the link bandwidth to the cumulative downstream
bandwidth (sum of the link bandwidths of all our multipaths) as this
makes the most sense. It is also implied by
https://tools.ietf.org/html/draft-mohanty-bess-ebgp-dmz. Of course, do
not override the link bandwidth if it has been specified by policy.

Note: Transitive extended communities will be automatically passed along
to EBGP peers; this commit is updating the value that is announced to
something that is the most appropriate.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
4 years agobgpd: Additional options for generating link bandwidth
vivek [Tue, 24 Mar 2020 20:57:44 +0000 (13:57 -0700)]
bgpd: Additional options for generating link bandwidth

Implement the code to handle the other route-map options to generate
the link bandwidth, namely, to use the cumulative bandwidth or to
base this on the number of multipaths. In the latter case, a reference
bandwidth is internally chosen - the implementation uses a value of
1 Gbps.

These additional options mean that the prefix may need to be advertised
if there is a link bandwidth change, which is a new criteria. Define a
new path (change) flag to support this and implement the advertisement.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
4 years agobgpd: Ensure link bandwidth extcommunity is not repeated
vivek [Tue, 24 Mar 2020 20:53:09 +0000 (13:53 -0700)]
bgpd: Ensure link bandwidth extcommunity is not repeated

The BGP link bandwidth extended community must not be repeated. If the
attribute already carries this and the route-map specifies a new value,
the implementation will honor the policy configuration and overwrite
the existing values.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agobgpd: Ability to add/update unique extended communities
vivek [Tue, 24 Mar 2020 20:50:20 +0000 (13:50 -0700)]
bgpd: Ability to add/update unique extended communities

Certain extended communities cannot be repeated. An example is the
BGP link bandwidth extended community. Enhance the extended community
add function to ensure uniqueness, if requested.

Note: This commit does not change the lack of uniqueness for any of
the already-supported extended communities. Many of them such as the
BGP route target can obviously be present multiple times. Others like
the Router's MAC should most probably be present only once. The portions
of the code which add these may already be structured such that duplicates
do not arise.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agobgpd: Install multipath routes with weights
vivek [Tue, 24 Mar 2020 19:25:28 +0000 (12:25 -0700)]
bgpd: Install multipath routes with weights

Perform weighted ECMP if the multipaths have link bandwidth. This involves
assigning weights to each of the next hops associated with the prefix based
on the link bandwidth of the corresponding path as a factor of the total
(cumulative) link bandwidth for the prefix. The weight values used are
between 1 and 100. Weights are assigned only if all paths in the multipath
have link bandwidth, otherwise any bandwidths are ignored and regular
ECMP is performed. This is as recommended in
https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth

A subsequent commit will implement additional (user-configurable) behaviors.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
4 years agobgpd: Track link bandwidth during multipath calc
vivek [Tue, 24 Mar 2020 19:22:17 +0000 (12:22 -0700)]
bgpd: Track link bandwidth during multipath calc

During multipath update, track the cumulative link bandwidth
as well as update flags appropriately.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
4 years agobgpd: Add link-bandwidth fields for multipath calc
vivek [Tue, 24 Mar 2020 19:19:37 +0000 (12:19 -0700)]
bgpd: Add link-bandwidth fields for multipath calc

Introduce fields in the multipath structure for link bandwidth handling.
In the process, the mp_count field is changed to a uint16 as that is the
value set anyway.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agobgpd: Check and extract link bandwidth value
vivek [Tue, 24 Mar 2020 19:17:19 +0000 (12:17 -0700)]
bgpd: Check and extract link bandwidth value

Extract link bandwidth value into attribute from the extended
community, if present.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agobgpd: Display link bandwidth extended community
vivek [Tue, 24 Mar 2020 19:00:24 +0000 (12:00 -0700)]
bgpd: Display link bandwidth extended community

Additional extended community definitions and display of link-bandwidth
extended community.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agobgpd: Add link bandwidth route-map commands
vivek [Tue, 24 Mar 2020 18:50:44 +0000 (11:50 -0700)]
bgpd: Add link bandwidth route-map commands

Implement route-map option to set the link-bandwidth extended
community. The command is of the form:

set extcommunity bandwidth <(1-26214400)|cumulative|num-multipaths>
[non-transitive]

The options available are to specify the actual bandwidth value in
Mbps, base it on the cumulative downstream bandwidth or base it on
the number of multipaths. The last option is based on
https://tools.ietf.org/html/draft-mohanty-bess-ebgp-dmz. Further,
in alignment with the use case described in this IETF draft, the
extended community is encoded as transitive by default. There is an
option available to specify that it should be non-transitive.

The link-bandwidth itself is carried in bytes per second as specifed in
https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth

Note: This commit only handles the processing for bandwidth specifed
as a value; subsequent commits will handle the processing of the other
options.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
4 years agobgpd: Add link bandwidth extended community definition
vivek [Tue, 24 Mar 2020 17:23:04 +0000 (10:23 -0700)]
bgpd: Add link bandwidth extended community definition

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agoMerge pull request #6116 from qlyoung/change-watchfrr-messages-to-info
Renato Westphal [Mon, 30 Mar 2020 22:35:39 +0000 (19:35 -0300)]
Merge pull request #6116 from qlyoung/change-watchfrr-messages-to-info

watchfrr: change some messages from errors to info

4 years agoMerge pull request #6117 from qlyoung/fix-grpc-plugin-with-daemonize
Renato Westphal [Mon, 30 Mar 2020 22:34:30 +0000 (19:34 -0300)]
Merge pull request #6117 from qlyoung/fix-grpc-plugin-with-daemonize

lib: defer grpc plugin initialization to post fork