]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years ago*: Avoid casting to the same type as on the left
Donatas Abraitis [Sun, 8 May 2022 13:07:42 +0000 (16:07 +0300)]
*: Avoid casting to the same type as on the left

Just not necessary.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11145 from donaldsharp/bgp_capability
Donatas Abraitis [Thu, 5 May 2022 19:28:56 +0000 (22:28 +0300)]
Merge pull request #11145 from donaldsharp/bgp_capability

Bgp capability

2 years agoMerge pull request #11059 from anlancs/fix/bgpd-evnp-wrong-check-hashget
Donatas Abraitis [Wed, 4 May 2022 18:19:51 +0000 (21:19 +0300)]
Merge pull request #11059 from anlancs/fix/bgpd-evnp-wrong-check-hashget

bgpd: fix memory leak for evpn

2 years agoMerge pull request #11144 from ton31337/fix/bgp_notification_gr
Donald Sharp [Wed, 4 May 2022 16:05:50 +0000 (12:05 -0400)]
Merge pull request #11144 from ton31337/fix/bgp_notification_gr

bgpd: Fix memory leak for bgp_notify_receive()

2 years agobgpd: peer groups should not toggle interface based nht tracking
Donald Sharp [Tue, 3 May 2022 19:24:28 +0000 (15:24 -0400)]
bgpd: peer groups should not toggle interface based nht tracking

Peer groups when various forms of `bgp capability extended-nexthop`
is entered on them are toggling the nexthop tracking status of peers
in their peer group.  This is ok when the peer is not interface based.
But it is not ok when the peer is interface based as that it will turn
off the ability of FRR to properly work with that peer type.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Refuse to let interfaced peering to change capability extended-nexthop
Donald Sharp [Tue, 3 May 2022 19:23:14 +0000 (15:23 -0400)]
bgpd: Refuse to let interfaced peering to change capability extended-nexthop

Do not interface based peers change anything about when a
[no] neighbor <interface> capability extended-nexthop
is entered.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: enhanced capability is always turned on for interface based peers
Donald Sharp [Tue, 3 May 2022 16:51:21 +0000 (12:51 -0400)]
bgpd: enhanced capability is always turned on for interface based peers

FRR is displaying that the peer enhanced capability command is not
turned on when the interface is part of a peer group.  Saving the
config and then reloading actually turns it off.

Fix the code so that FRR does not display the enhanced capability
for interface based peers.

Fixes: #11108
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11137 from opensourcerouting/if-name-len-fixes
Donald Sharp [Wed, 4 May 2022 11:44:26 +0000 (07:44 -0400)]
Merge pull request #11137 from opensourcerouting/if-name-len-fixes

*: standardize interface name maximum length

2 years agobgpd: Fix memory leak for bgp_notify_receive()
Donatas Abraitis [Wed, 4 May 2022 10:27:47 +0000 (13:27 +0300)]
bgpd: Fix memory leak for bgp_notify_receive()

Initialize outer/inner bgp_notify structs to zero.

Free bgp_notify.raw_data after use.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11142 from patrasar/pim_register_show_fix
Rafael Zalamena [Tue, 3 May 2022 20:01:30 +0000 (17:01 -0300)]
Merge pull request #11142 from patrasar/pim_register_show_fix

pimd: fixing wrong diplay registerTx

2 years agopimd: fixing wrong diplay registerTx
sarita patra [Tue, 3 May 2022 15:53:47 +0000 (08:53 -0700)]
pimd: fixing wrong diplay registerTx

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agoMerge pull request #11110 from anlancs/fix/bfdd-wrong-local
Sri Mohana Singamsetty [Mon, 2 May 2022 23:53:42 +0000 (16:53 -0700)]
Merge pull request #11110 from anlancs/fix/bfdd-wrong-local

bfdd: fix wrong local address of display command

2 years agoMerge pull request #11136 from donaldsharp/stupidity
Donatas Abraitis [Mon, 2 May 2022 19:48:38 +0000 (22:48 +0300)]
Merge pull request #11136 from donaldsharp/stupidity

tests: Use XCALLOC instead of XMALLOC for threads

2 years agoMerge pull request #11128 from opensourcerouting/feature/rfc8538
Donald Sharp [Mon, 2 May 2022 18:08:04 +0000 (14:08 -0400)]
Merge pull request #11128 from opensourcerouting/feature/rfc8538

bgpd: Implement GR N-Bit and CEASE/Hard Reset notification

2 years agoMerge pull request #11113 from opensourcerouting/pim6-icmp6-replace-bpf
Donald Sharp [Mon, 2 May 2022 17:19:47 +0000 (13:19 -0400)]
Merge pull request #11113 from opensourcerouting/pim6-icmp6-replace-bpf

pim6d: use ICMP6_FILTER instead of BPF on mroute

2 years agoMerge pull request #11132 from anlancs/fix/bgpd-prefix
Donald Sharp [Mon, 2 May 2022 17:17:08 +0000 (13:17 -0400)]
Merge pull request #11132 from anlancs/fix/bgpd-prefix

bgpd: delay "stream_new" in str2prefix_rd()

2 years agotests: Use XCALLOC instead of XMALLOC for threads
Donald Sharp [Mon, 2 May 2022 17:00:47 +0000 (13:00 -0400)]
tests: Use XCALLOC instead of XMALLOC for threads

Someone decided to do malloc testing over make check.

Fixes: #11120
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years ago*: remove the checking returned value for hash_get()
anlan_cs [Thu, 21 Apr 2022 06:37:12 +0000 (02:37 -0400)]
*: remove the checking returned value for hash_get()

Firstly, *keep no change* for `hash_get()` with NULL
`alloc_func`.

Only focus on cases with non-NULL `alloc_func` of
`hash_get()`.

Since `hash_get()` with non-NULL `alloc_func` parameter
shall not fail, just ignore the returned value of it.
The returned value must not be NULL.
So in this case, remove the unnecessary checking NULL
or not for the returned value and add `void` in front
of it.

Importantly, also *keep no change* for the two cases with
non-NULL `alloc_func` -
1) Use `assert(<returned_data> == <searching_data>)` to
   ensure it is a created node, not a found node.
   Refer to `isis_vertex_queue_insert()` of isisd, there
   are many examples of this case in isid.
2) Use `<returned_data> != <searching_data>` to judge it
   is a found node, then free <searching_data>.
   Refer to `aspath_intern()` of bgpd, there are many
   examples of this case in bgpd.

Here, <returned_data> is the returned value from `hash_get()`,
and <searching_data> is the data, which is to be put into
hash table.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agobgpd: fix memory leak for evpn
anlan_cs [Wed, 20 Apr 2022 10:57:53 +0000 (06:57 -0400)]
bgpd: fix memory leak for evpn

If `hash_get()` returns NULL, the list created with
`list_new()` is not be freed.

Since `hash_get()` should not fail, we don't need
`list_delete()` and other boring `XFREE()`s for its
failure case.

Just ignore returning value of `hash_get()` in these
cases.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agolib: change FRR interface name length definition
Rafael Zalamena [Mon, 2 May 2022 16:02:31 +0000 (13:02 -0300)]
lib: change FRR interface name length definition

Use the OS provided maximum name length instead of defining an arbitrary
one.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 years ago*: use FRR interface name definition everywhere
Rafael Zalamena [Mon, 2 May 2022 16:00:12 +0000 (13:00 -0300)]
*: use FRR interface name definition everywhere

Don't rely on the OS interface name length definition and use the FRR
definition instead.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 years agobfdd: remove "local_address" of bfd session
ewlumpkin [Thu, 10 Feb 2022 22:07:38 +0000 (17:07 -0500)]
bfdd: remove "local_address" of bfd session

The "local_address" of bfd is only used in `show bfd peers brief`
for single hop sessions which are configured without "local address".
Since it is set by destination address of received packet, not
completely correct, so remove it.

Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agopbrd: fix interface compare usage
Rafael Zalamena [Fri, 29 Apr 2022 16:50:26 +0000 (13:50 -0300)]
pbrd: fix interface compare usage

Don't use `strncmp` when we expect to match the whole string.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 years agobgpd: fix interface name compare
Rafael Zalamena [Fri, 29 Apr 2022 16:49:08 +0000 (13:49 -0300)]
bgpd: fix interface name compare

We always want to compare the whole string, lets not use `strncmp` for
this case.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 years agobgpd: delay "stream_new" in str2prefix_rd()
anlan_cs [Sun, 1 May 2022 12:33:01 +0000 (08:33 -0400)]
bgpd: delay "stream_new" in str2prefix_rd()

`stream_new` in `str2prefix_rd()` can be called after some
checkings are passed, so the last `if (s)` in this fuction will
make sense.

Additionally some changes for `str2prefix_rd()`:
1) Use `RD_BYTES` instead of hard number for `stream_new()`
2) Remove unnecessary `lret` variable

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoMerge pull request #10742 from plsaranya/pim_register
mobash-rasool [Mon, 2 May 2022 07:46:03 +0000 (13:16 +0530)]
Merge pull request #10742 from plsaranya/pim_register

pim6d: Register message send handling

2 years agobgpd: Implement CEASE/Hard Reset notification
Donatas Abraitis [Sat, 30 Apr 2022 20:04:58 +0000 (23:04 +0300)]
bgpd: Implement CEASE/Hard Reset notification

Also, add N-Bit (Notification) flag for Graceful Restart.

This is a preparation for RFC8538.

More information: https://datatracker.ietf.org/doc/html/rfc8538

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11119 from kuldeepkash/pim_v6
Donatas Abraitis [Sat, 30 Apr 2022 14:04:38 +0000 (17:04 +0300)]
Merge pull request #11119 from kuldeepkash/pim_v6

tests: [PIMv6] Using generic names for PIM verification APIs

2 years agotests: [PIMv6] Using generic names for pim verification APIs
Kuldeep Kashyap [Thu, 28 Apr 2022 13:35:38 +0000 (19:05 +0530)]
tests: [PIMv6] Using generic names for pim verification APIs

1. Modified pim APIs name to generic one, same APIs would be used for PIMv4 and PIMv6
verifications
2. Modified all affacted scripts and ran multiple times locally to avoid CI failures

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2 years agoMerge pull request #11122 from ak503/bgp_esi_str
Igor Ryzhov [Fri, 29 Apr 2022 15:59:59 +0000 (18:59 +0300)]
Merge pull request #11122 from ak503/bgp_esi_str

bgpd: fix size of esi_buf

2 years agoMerge pull request #11118 from opensourcerouting/time-fmt-nulls
Donald Sharp [Fri, 29 Apr 2022 14:00:05 +0000 (10:00 -0400)]
Merge pull request #11118 from opensourcerouting/time-fmt-nulls

lib: format NULL timevals correctly

2 years agobgpd: fix size of esi_buf
Dmitrii Turlupov [Fri, 29 Apr 2022 11:56:25 +0000 (14:56 +0300)]
bgpd: fix size of esi_buf

Fixes: #11111
Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
2 years agoMerge pull request #10988 from AbhishekNR/ipv6_mroute_cli
David Lamparter [Fri, 29 Apr 2022 08:23:37 +0000 (10:23 +0200)]
Merge pull request #10988 from AbhishekNR/ipv6_mroute_cli

2 years agoMerge pull request #11114 from opensourcerouting/vrf-declvar-macros
mobash-rasool [Fri, 29 Apr 2022 08:23:08 +0000 (13:53 +0530)]
Merge pull request #11114 from opensourcerouting/vrf-declvar-macros

lib, zebra, pimd: clean up/fix VRF DECLVAR macros

2 years agoMerge pull request #10964 from mobash-rasool/pim-zebra
David Lamparter [Fri, 29 Apr 2022 08:22:41 +0000 (10:22 +0200)]
Merge pull request #10964 from mobash-rasool/pim-zebra

zebra, pimd, pim6d: Modify code to get multicast IPv6 stats from kernel

2 years agopim6d: Register message send handling
plsaranya [Mon, 7 Mar 2022 04:38:31 +0000 (10:08 +0530)]
pim6d: Register message send handling

Register and Null register send handling
In IPv6 PIM Null Register message if dummy PIM Header is included as
data, this dummy PIM header checksum needs to be valuated

Signed-off-by: plsaranya <Saranya_Panjarathina@dell.com>
2 years agoMerge pull request #11090 from ton31337/fix/plist_alist_duplicate
Donald Sharp [Thu, 28 Apr 2022 16:42:18 +0000 (12:42 -0400)]
Merge pull request #11090 from ton31337/fix/plist_alist_duplicate

lib: Ignore duplicate alist/plist entries in CLI

2 years agolib: format NULL timevals correctly
David Lamparter [Thu, 28 Apr 2022 10:23:16 +0000 (12:23 +0200)]
lib: format NULL timevals correctly

Passing NULL for a `%pTVMs` would result in `(null)Ms`, i.e. the `Ms`
flags not eaten up.  Change to eat those up, and print `-` instead for
NULL times.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #11107 from opensourcerouting/prefix-more-unionizing
Donald Sharp [Thu, 28 Apr 2022 12:25:30 +0000 (08:25 -0400)]
Merge pull request #11107 from opensourcerouting/prefix-more-unionizing

lib: `struct prefix` spring cleaning

2 years agopim6d: Make pim_zlookup_sg_statistics available for v6
Mobashshera Rasool [Tue, 5 Apr 2022 14:55:22 +0000 (07:55 -0700)]
pim6d: Make pim_zlookup_sg_statistics available for v6

Since pim_zlookup.c is available for pimv6,
Call pim_zlookup_sg_statistics api for v6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agodoc: Updated the doc for show ipv6 mroute commands
Abhishek N R [Fri, 8 Apr 2022 07:55:31 +0000 (00:55 -0700)]
doc: Updated the doc for show ipv6 mroute commands

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agopim6d: Implementing "show ipv6 mroute summary" CLI
Abhishek N R [Fri, 8 Apr 2022 07:34:02 +0000 (00:34 -0700)]
pim6d: Implementing "show ipv6 mroute summary" CLI

Adding new show CLI to display ipv6 mroute summary information.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agopim6d: Implementing "show ipv6 mroute count" CLI
Abhishek N R [Fri, 8 Apr 2022 07:20:53 +0000 (00:20 -0700)]
pim6d: Implementing "show ipv6 mroute count" CLI

Adding new show CLI to display ipv6 mroute count information.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agopim6d: Implementing "show ipv6 mroute" CLI
Abhishek N R [Fri, 8 Apr 2022 06:52:28 +0000 (23:52 -0700)]
pim6d: Implementing "show ipv6 mroute" CLI

Adding new show CLI to display ipv6 mroute information.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agolib, zebra, pimd: clean up/fix VRF DECLVAR macros
David Lamparter [Thu, 28 Apr 2022 09:06:20 +0000 (11:06 +0200)]
lib, zebra, pimd: clean up/fix VRF DECLVAR macros

There's a common pattern of "get VRF context for CLI node" here, which
first got a helper macro in zebra that then permeated into pimd.

Unfortunately the pimd copy wasn't quite adjusted correctly and thus
caused two coverity warnings (CID 1517453, CID 1517454).

Fix the PIM one, and clean up by providing a common base macro in
`lib/vty.h`.

Also rename the macros (add `_VRF`) to make more clear what they do.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopim6d: use ICMP6_FILTER instead of BPF on mroute
David Lamparter [Wed, 27 Apr 2022 07:23:27 +0000 (09:23 +0200)]
pim6d: use ICMP6_FILTER instead of BPF on mroute

The ICMP6_FILTER option is always checked by the kernel, so the cost is
taken whether or not anything is set there.  Use it instead of taking on
additional cost with a BPF program.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agozebra: Removed show_ipv6_mroute cli from zebra_vty.c
Abhishek N R [Fri, 8 Apr 2022 06:01:37 +0000 (23:01 -0700)]
zebra: Removed show_ipv6_mroute cli from zebra_vty.c

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agopimd: Moving the common functions from pim_cmd.c
Abhishek N R [Fri, 8 Apr 2022 05:42:03 +0000 (22:42 -0700)]
pimd: Moving the common functions from pim_cmd.c

Moving the functions that are used by both IPV4 and IPV6 to a
common file pim_cmd_common.c file

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agozebra, pimd: Add a field family in the message ZEBRA_IPMR_ROUTE_STATS
Mobashshera Rasool [Mon, 4 Apr 2022 10:17:32 +0000 (03:17 -0700)]
zebra, pimd: Add a field family in the message ZEBRA_IPMR_ROUTE_STATS

1. Adding a field family in the existing ZEBRA_IPMR_ROUTE_STATS
to get the ipv4 as well as ipv6 trafic stats between pim and zebra.
2. Modify the debug to print both v4/v6 prefixes

pimd: pim6d: Modify pim_zlookup_sg_statistics to get ipv6 stats

Modify the pim_zlookup_sg_statistics api to
get ipv4/ipv6 stats from zebra. Making the api
common.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agozebra: Modify base code to get ipv6 stats from kernel
Mobashshera Rasool [Mon, 4 Apr 2022 11:05:07 +0000 (04:05 -0700)]
zebra: Modify base code to get ipv6 stats from kernel

Modify the structure mcast_route_data to store ipv4/ipv6
addr and lastused multicast information from kernel.
Adjust the related APIs to parse ipv4/ipv6 informations.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #11031 from AbhishekNR/v6_multicast
David Lamparter [Thu, 28 Apr 2022 08:06:00 +0000 (10:06 +0200)]
Merge pull request #11031 from AbhishekNR/v6_multicast

2 years agoMerge pull request #11106 from donaldsharp/werror_error_error
David Lamparter [Thu, 28 Apr 2022 07:49:49 +0000 (09:49 +0200)]
Merge pull request #11106 from donaldsharp/werror_error_error

2 years agobgpd: Rename graceful restart constants for R-bit capabilities
Donatas Abraitis [Wed, 27 Apr 2022 19:30:29 +0000 (22:30 +0300)]
bgpd: Rename graceful restart constants for R-bit capabilities

Just to better understand what they mean.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Rename graceful restart constants for R/F flags
Donatas Abraitis [Wed, 27 Apr 2022 18:50:58 +0000 (21:50 +0300)]
bgpd: Rename graceful restart constants for R/F flags

Just to better understand what they mean.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11098 from opensourcerouting/zapi-mrib-v6
Donald Sharp [Wed, 27 Apr 2022 13:27:49 +0000 (09:27 -0400)]
Merge pull request #11098 from opensourcerouting/zapi-mrib-v6

zebra, pimd: add IPv6 support to NEXTHOP_LOOKUP_MRIB

2 years agolib: prefix unionization
David Lamparter [Fri, 8 Apr 2022 16:17:38 +0000 (18:17 +0200)]
lib: prefix unionization

Ahead of May 1st, the workers of the prefix have decided on more
unionization.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agotests: Correctly align variable type in tests
Donald Sharp [Wed, 27 Apr 2022 12:16:50 +0000 (08:16 -0400)]
tests: Correctly align variable type in tests

New compilers are noticing that the tests are compiling with
a pointer for the bgpd_privs variable while the bgp library
that is being linked against is not a pointer.  Since
these tests had the declaration just to make the compiler
happy, let's actually align the variable type to make the
compiler even happier.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Ensure pkt_afi and pkt_safi are not used uninited in some cases
Donald Sharp [Wed, 27 Apr 2022 11:57:41 +0000 (07:57 -0400)]
bgpd: Ensure pkt_afi and pkt_safi are not used uninited in some cases

The compiler is, rightly, pointing out that in some cases it is
possible that the pkt_afi and pkt_safi values are not properly
set and could result in a use before initialized.  I do not
actually belive that this is possible, but let's make the compiler
happy.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agodoc: Updated the doc for show ipv6 multicast commands
Abhishek N R [Wed, 20 Apr 2022 04:40:06 +0000 (21:40 -0700)]
doc: Updated the doc for show ipv6 multicast commands

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agopim6d: Implementing "show ipv6 multicast count" CLI
Abhishek N R [Thu, 14 Apr 2022 07:07:41 +0000 (00:07 -0700)]
pim6d: Implementing "show ipv6 multicast count" CLI

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agopim6d: Implementing "show ipv6 multicast" CLI
Abhishek N R [Thu, 14 Apr 2022 06:30:28 +0000 (23:30 -0700)]
pim6d: Implementing "show ipv6 multicast" CLI

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agolib: remove unused `struct prefix_ptr`
David Lamparter [Wed, 27 Apr 2022 11:19:46 +0000 (13:19 +0200)]
lib: remove unused `struct prefix_ptr`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #11095 from ecbaldwin/unlock-node-always
Donald Sharp [Tue, 26 Apr 2022 19:26:03 +0000 (15:26 -0400)]
Merge pull request #11095 from ecbaldwin/unlock-node-always

bgpd: ensure that the node gets unlocked in all cases

2 years agobgpd: ensure that the node gets unlocked in all cases
Carl Baldwin [Wed, 29 Dec 2021 21:32:33 +0000 (14:32 -0700)]
bgpd: ensure that the node gets unlocked in all cases

The logic to unlock dest if iteration completed without iterating the
entire node was flawed. Specifically, if iteration terminated due to
`gr_deferred == 0` then the node would not get unlocked.

This change takes into account the fact that dest will be NULL only in
the case when the entire table was iterated and all nodes were already
unlocked. In any other case, it needs to be unlocked.

Signed-off-by: Carl Baldwin <carl@ecbaldwin.net>
2 years agoMerge pull request #11076 from routingrocks/vrrp_master_ad_cli
Russ White [Tue, 26 Apr 2022 15:37:15 +0000 (11:37 -0400)]
Merge pull request #11076 from routingrocks/vrrp_master_ad_cli

vrrpd: Fix display of 'Master Advertisement interval'

2 years agoMerge pull request #11079 from opensourcerouting/staticd-nht-refactor-fix-startrace
Russ White [Tue, 26 Apr 2022 15:36:34 +0000 (11:36 -0400)]
Merge pull request #11079 from opensourcerouting/staticd-nht-refactor-fix-startrace

staticd: reorg, refactor and improve NHT code

2 years agoMerge pull request #11088 from opensourcerouting/pim-debug-snafus
mobash-rasool [Tue, 26 Apr 2022 15:35:50 +0000 (21:05 +0530)]
Merge pull request #11088 from opensourcerouting/pim-debug-snafus

pimd: fix SNAFUs in debug flags

2 years agopimd: clean up zlookup nexthop handling
David Lamparter [Tue, 26 Apr 2022 14:10:15 +0000 (16:10 +0200)]
pimd: clean up zlookup nexthop handling

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopim6d: implement/un-stub MRIB lookup
David Lamparter [Thu, 10 Mar 2022 14:38:59 +0000 (15:38 +0100)]
pim6d: implement/un-stub MRIB lookup

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agozebra, pimd: add AF param on NEXTHOP_LOOKUP_MRIB
David Lamparter [Tue, 26 Apr 2022 12:52:53 +0000 (14:52 +0200)]
zebra, pimd: add AF param on NEXTHOP_LOOKUP_MRIB

By changing this API call to use a `struct ipaddr`, which encodes the
type of IP address with it.  (And rename/remove the `IPV4` from the
command name.)

Also add a comment explaining that this function call is going to be
obsolete in the long run since pimd needs to move to proper MRIB NHT.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agozebra: add rib_match_ipv6_multicast variant
David Lamparter [Tue, 26 Apr 2022 12:29:38 +0000 (14:29 +0200)]
zebra: add rib_match_ipv6_multicast variant

... for IPv6, analogous to v4.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: Moving the common functions from pim_cmd.c
Abhishek N R [Thu, 7 Apr 2022 10:35:22 +0000 (03:35 -0700)]
pimd: Moving the common functions from pim_cmd.c

Moving the functions that are used by both IPV4 and IPV6 to a
common file pim_cmd_common.c file

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agoMerge pull request #10712 from patrasar/pim_nexthop_prefix_to_pimaddr
David Lamparter [Tue, 26 Apr 2022 13:39:36 +0000 (15:39 +0200)]
Merge pull request #10712 from patrasar/pim_nexthop_prefix_to_pimaddr

2 years agoMerge pull request #10980 from SaiGomathiN/namechng
David Lamparter [Tue, 26 Apr 2022 13:26:42 +0000 (15:26 +0200)]
Merge pull request #10980 from SaiGomathiN/namechng

2 years agoMerge pull request #11077 from anlancs/fix/bfdd-hang-pathdown
Rafael Zalamena [Tue, 26 Apr 2022 13:00:32 +0000 (10:00 -0300)]
Merge pull request #11077 from anlancs/fix/bfdd-hang-pathdown

bfdd: fix broken FSM in active mode

2 years agoMerge pull request #11074 from fdumontet6WIND/FMJA/isis_ldp_close
Russ White [Tue, 26 Apr 2022 12:47:10 +0000 (08:47 -0400)]
Merge pull request #11074 from fdumontet6WIND/FMJA/isis_ldp_close

isisd: ldp cleaning issue on invalid sptree

2 years agoMerge pull request #11083 from anlancs/fix/bgpd-minor-format
Russ White [Tue, 26 Apr 2022 12:40:27 +0000 (08:40 -0400)]
Merge pull request #11083 from anlancs/fix/bgpd-minor-format

bgpd: optimize "auto_rt" searching procedure for evpn

2 years agoMerge pull request #11086 from ton31337/feature/rmap_aspath_replace
Russ White [Tue, 26 Apr 2022 12:38:58 +0000 (08:38 -0400)]
Merge pull request #11086 from ton31337/feature/rmap_aspath_replace

bgpd: Add `set as-path replace <any|ASN>` cmd for route-maps

2 years agoMerge pull request #11092 from ton31337/fix/reuse_addf_json
Russ White [Tue, 26 Apr 2022 12:35:53 +0000 (08:35 -0400)]
Merge pull request #11092 from ton31337/fix/reuse_addf_json

bgpd: Drop inet_ntop for route_vty_out_overlay()

2 years agoMerge pull request #11089 from opensourcerouting/build-gcc-11.2
Igor Ryzhov [Tue, 26 Apr 2022 10:18:18 +0000 (13:18 +0300)]
Merge pull request #11089 from opensourcerouting/build-gcc-11.2

build: fix new gcc 11.2 warnings

2 years agopimd: add missing `debug igmp trace detail`
David Lamparter [Mon, 25 Apr 2022 12:01:42 +0000 (14:01 +0200)]
pimd: add missing `debug igmp trace detail`

The flag was defined but there was no command to actually enable it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: fix reversed logic for "debug ... detail"
David Lamparter [Mon, 25 Apr 2022 11:53:17 +0000 (13:53 +0200)]
pimd: fix reversed logic for "debug ... detail"

The normal flag was enabling detail messages, but what we want is the
detail flag enabling normal messages.

Remove the _ONLY macro while at it, it's only used for config print &
that seems like a place where making the difference explicitly visible
is helpful regardless.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #11085 from bobuhiro11/fix_func_bits
Donatas Abraitis [Tue, 26 Apr 2022 06:21:39 +0000 (09:21 +0300)]
Merge pull request #11085 from bobuhiro11/fix_func_bits

bgpd: take SRv6 func-bits into account when generating SIDs

2 years agoMerge pull request #11081 from donaldsharp/bgp_import_check
Sri Mohana Singamsetty [Mon, 25 Apr 2022 22:59:46 +0000 (15:59 -0700)]
Merge pull request #11081 from donaldsharp/bgp_import_check

bgpd: Fix import check removal

2 years agoMerge pull request #11080 from chiragshah6/fdev1
Russ White [Mon, 25 Apr 2022 19:21:38 +0000 (15:21 -0400)]
Merge pull request #11080 from chiragshah6/fdev1

tools: frr-reload fix bgp neighbor and bgp instance deletion

2 years agobgpd: Drop inet_ntop for route_vty_out_overlay()
Donatas Abraitis [Mon, 25 Apr 2022 17:34:20 +0000 (20:34 +0300)]
bgpd: Drop inet_ntop for route_vty_out_overlay()

Reuse %pI4/%pI6/%pIA

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agolib: Ignore duplicate alist/plist entries in CLI
Donatas Abraitis [Mon, 25 Apr 2022 16:06:49 +0000 (19:06 +0300)]
lib: Ignore duplicate alist/plist entries in CLI

If duplicate value is entered, the whole plist/alist just dropped.

Before:
```
$ grep prefix-list /etc/frr/frr.conf
ip prefix-list test seq 5 permit 1.1.1.1/32
ip prefix-list test seq 10 permit 1.1.1.1/32
$ systemctl restart frr
$ vtysh -c 'show run | include prefix-list'
$
```

After:
```
$ grep prefix-list /etc/frr/frr.conf
ip prefix-list test seq 5 permit 1.1.1.1/32
ip prefix-list test seq 10 permit 1.1.1.1/32
$ systemctl restart frr
$ vtysh -c 'show run | include prefix-list'
ip prefix-list test seq 5 permit 1.1.1.1/32
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobuild: fix new gcc 11.2 warnings
David Lamparter [Mon, 25 Apr 2022 12:07:41 +0000 (14:07 +0200)]
build: fix new gcc 11.2 warnings

Some recent improvement in GCC triggers 2 new warnings, and they're
actual bugs (reading beyond end of prefix_ipv6 by accessing it as
prefix, which is larger.)  Luckily it's only in sharpd.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobgpd: Add `set as-path replace <any|ASN>` cmd for route-maps
Donatas Abraitis [Mon, 25 Apr 2022 07:34:36 +0000 (10:34 +0300)]
bgpd: Add `set as-path replace <any|ASN>` cmd for route-maps

```
route-map tstas permit 10
 set as-path replace 1
exit
```

Before:

```
donatas-laptop(config-router-af)# do show ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 13
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.10.65
  65000 1 2 3 123
    192.168.10.65 from 192.168.10.65 (10.10.10.11)
      Origin IGP, metric 0, valid, external, best (First path received)
      Last update: Mon Apr 25 10:39:50 2022
```

After:

```
donatas-laptop(config-router-af)# do show ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 15
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.10.65
  65000 65010 2 3 123
    192.168.10.65 from 192.168.10.65 (10.10.10.11)
      Origin IGP, metric 0, valid, external, best (First path received)
      Last update: Mon Apr 25 10:40:16 2022
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: take SRv6 func-bits into account when generating SIDs
Nobuhiro MIKI [Mon, 25 Apr 2022 08:17:28 +0000 (17:17 +0900)]
bgpd: take SRv6 func-bits into account when generating SIDs

Prior to this fix, the magic number (16) was used regardless of what value
the user specified for func-bits. With this fix, user-specified values are
handled appropriately.

Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
2 years agobgpd: optimize "auto_rt" searching procedure for evpn
anlan_cs [Sun, 24 Apr 2022 11:49:02 +0000 (07:49 -0400)]
bgpd: optimize "auto_rt" searching procedure for evpn

RT value will be unique across different VNIs but the
same across routers (in the same AS) for a particula
VNI.

It is unique, so add `break` for search procedure.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agobgpd: minor style change
anlan_cs [Mon, 25 Apr 2022 08:16:44 +0000 (04:16 -0400)]
bgpd: minor style change

Correct two style places and one comment.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agopim6d: Modifying the mld group watermark command name
Sai Gomathi N [Fri, 8 Apr 2022 06:01:34 +0000 (23:01 -0700)]
pim6d: Modifying the mld group watermark command name

Modifying the "mld_group_watermark_cmd" to "ipv6_mld_group_watermark_cmd"
and "igmp_group_watermark_cmd" to "ip_igmp_group_watermark_cmd" for consistency.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2 years agopim6d: Removing duplicate PIM_DECLVAR_CONTEXT macro
Sai Gomathi N [Thu, 7 Apr 2022 12:17:49 +0000 (05:17 -0700)]
pim6d: Removing duplicate PIM_DECLVAR_CONTEXT macro

Removing the duplicate PIM_DECLVAR_CONTEXT from
pim_common_cmd.h file.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2 years agoMerge pull request #11067 from donaldsharp/domainname
Donatas Abraitis [Mon, 25 Apr 2022 04:40:58 +0000 (07:40 +0300)]
Merge pull request #11067 from donaldsharp/domainname

lib: Ensure an empty string does not get printed for host/domain

2 years agobgpd: Fix import check removal
Donald Sharp [Sun, 24 Apr 2022 20:52:46 +0000 (16:52 -0400)]
bgpd: Fix import check removal

Fix: 06e4e90132ad23815c6f288dd7e6be334f5ab233

Modified BGP to pay more attention the prefix returned from
zebra to ensure that a LPM wasn't accidently causing BGP
import checks to think it had a match when it did not.
This unfortunately removed the check to handle the route
removal.

This sequence of config and events would leave BGP in a bad state:
ip route 100.100.100.0/24 Null0
router bgp 32932
  bgp network import-check
  address-family ipv4 uni
    network 100.100.100.0/24

Then if you removed the static route the import check would
still think the route existed:

donatas-pc(config)# ip route 100.100.100.0/24 Null0

donatas-pc(config)# do sh ip bgp import-check-table
Current BGP import check cache:
 100.100.100.0 valid [IGP metric 0], #paths 1
  blackhole
  Last update: Sat Apr 23 22:51:34 2022

donatas-pc(config)# do sh ip nht
100.100.100.0
 resolved via static
 is directly connected, Null0
 Client list: bgp(fd 17)

donatas-pc(config)# do sh ip bgp neighbors 192.168.10.123 advertised-routes | include 100.100.100.0
*> 100.100.100.0/24 0.0.0.0                  0         32768 i

donatas-pc(config)# no ip route 100.100.100.0/24 Null0

donatas-pc(config)# do sh ip nht
100.100.100.0
 resolved via kernel
 via 192.168.10.1, enp3s0
 Client list: bgp(fd 17)

donatas-pc(config)# do sh ip bgp import-check-table
Current BGP import check cache:
 100.100.100.0 valid [IGP metric 0], #paths 1
  blackhole
  Last update: Sat Apr 23 22:51:34 2022

donatas-pc(config)# do sh ip bgp neighbors 192.168.10.123 advertised-routes | include 100.100.100.0
*> 100.100.100.0/24 0.0.0.0                  0         32768 i
donatas-pc(config)#

Fix this by moving the code to handle the prefix check to the
evaluation function and mark the bnc as not matching and actually
evaluate the bnc.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotools: string literals -> comments
Chirag Shah [Sun, 24 Apr 2022 18:48:08 +0000 (11:48 -0700)]
tools: string literals -> comments

Convert string literals to comment.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 years agostaticd: redo VRF_DEFAULT NHT registers on connect
David Lamparter [Sun, 24 Apr 2022 15:17:30 +0000 (17:17 +0200)]
staticd: redo VRF_DEFAULT NHT registers on connect

Other VRFs get VRF_ADD notifications from zebra which triggers
static_fixup_vrf_ids, but since the default VRF is implicit we need to
make that same call on connect.

This should fix problems with staticd being started before (or
concurrent with and thus racing) zebra.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agostaticd: merge NHT register & update, reorganize
David Lamparter [Sun, 24 Apr 2022 15:10:52 +0000 (17:10 +0200)]
staticd: merge NHT register & update, reorganize

nh_update is only called in two places and both precede a matching
follow-up nht_register call.  Fold the update into register, and make
register do the right thing™ for all cases (i.e. update refcounts as
needed, and retry zebra NHT registration if it failed before).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agostaticd: use double pointer for NHT decref
David Lamparter [Sun, 24 Apr 2022 13:52:23 +0000 (15:52 +0200)]
staticd: use double pointer for NHT decref

Since this is a free()-type function, clear the caller's pointer to
NULL to aid static analysis and prevent UAF bugs.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>