]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
6 months agotests: add a new topotest to bgp_aigp
Enke Chen [Wed, 16 Oct 2024 18:19:28 +0000 (11:19 -0700)]
tests: add a new topotest to bgp_aigp

Add a new topotest for getting the aigp from the "igp-metric"
for a redistributed route (ospf route in the test).

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 51612593f7f747d0003a48a41367be87d3ea5361)

6 months agobgpd: fix several issues in sourcing AIGP attribute
Enke Chen [Wed, 16 Oct 2024 18:15:28 +0000 (11:15 -0700)]
bgpd: fix several issues in sourcing AIGP attribute

Fix several issues in sourcing AIGP attribute:

1) AIGP should not be set as default for a redistributed route or a
   static network. It should be set by config instead.

2) AIGP sourced by "set aigp-metric igp-metric" in a route-map does
   not set the correct value for a redistributed route.

3) When redistribute a connected route like loopback, the AGIP (with
   value 0) is sourced by "set aigp-metric igp-metric", but the
   attribute is not propagated as the attribute flag is not set.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit f65356d8bb9a43b1725fafdbd30aba0de9d214fa)

6 months agoMerge pull request #17143 from FRRouting/mergify/bp/dev/10.2/pr-17020
Donald Sharp [Wed, 16 Oct 2024 19:23:38 +0000 (15:23 -0400)]
Merge pull request #17143 from FRRouting/mergify/bp/dev/10.2/pr-17020

zebra: fix heap-use-after free on ns shutdown (backport #17020)

6 months agoMerge pull request #17129 from FRRouting/mergify/bp/dev/10.2/pr-17116
Donald Sharp [Wed, 16 Oct 2024 16:49:30 +0000 (12:49 -0400)]
Merge pull request #17129 from FRRouting/mergify/bp/dev/10.2/pr-17116

zebra: unlock node only after operation in zebra_free_rnh() (backport #17116)

6 months agozebra: fix heap-use-after free on ns shutdown
Philippe Guibert [Mon, 7 Oct 2024 13:11:43 +0000 (15:11 +0200)]
zebra: fix heap-use-after free on ns shutdown

The following ASAN issue has been observed:

> ERROR: AddressSanitizer: heap-use-after-free on address 0x6160000acba4 at pc 0x55910c5694d0 bp 0x7ffe3a8ac850 sp 0x7ffe3a8ac840
> READ of size 4 at 0x6160000acba4 thread T0
>         #0 0x55910c5694cf in ctx_info_from_zns zebra/zebra_dplane.c:3315
>     #1 0x55910c569696 in dplane_ctx_ns_init zebra/zebra_dplane.c:3331
>     #2 0x55910c56bf61 in dplane_ctx_nexthop_init zebra/zebra_dplane.c:3680
>     #3 0x55910c5711ca in dplane_nexthop_update_internal zebra/zebra_dplane.c:4490
>     #4 0x55910c571c5c in dplane_nexthop_delete zebra/zebra_dplane.c:4717
>     #5 0x55910c61e90e in zebra_nhg_uninstall_kernel zebra/zebra_nhg.c:3413
>     #6 0x55910c615d8a in zebra_nhg_decrement_ref zebra/zebra_nhg.c:1919
>     #7 0x55910c6404db in route_entry_update_nhe zebra/zebra_rib.c:454
>     #8 0x55910c64c904 in rib_re_nhg_free zebra/zebra_rib.c:2822
>     #9 0x55910c655be2 in rib_unlink zebra/zebra_rib.c:4212
>     #10 0x55910c6430f9 in zebra_rtable_node_cleanup zebra/zebra_rib.c:968
>     #11 0x7f26f275b8a9 in route_node_free lib/table.c:75
>     #12 0x7f26f275bae4 in route_table_free lib/table.c:111
>     #13 0x7f26f275b749 in route_table_finish lib/table.c:46
>     #14 0x55910c65db17 in zebra_router_free_table zebra/zebra_router.c:191
>     #15 0x55910c65dfb5 in zebra_router_terminate zebra/zebra_router.c:244
>     #16 0x55910c4f40db in zebra_finalize zebra/main.c:249
>     #17 0x7f26f2777108 in event_call lib/event.c:2011
>     #18 0x7f26f264180e in frr_run lib/libfrr.c:1212
>     #19 0x55910c4f49cb in main zebra/main.c:531
>     #20 0x7f26f2029d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
>     #21 0x7f26f2029e3f in __libc_start_main_impl ../csu/libc-start.c:392
>     #22 0x55910c4b0114 in _start (/usr/lib/frr/zebra+0x1ae114)

It happens with FRR using the kernel. During shutdown, the
namespace identifier is attempted to be obtained by zebra, in an
attempt to prepare zebra dataplane nexthop messages.

Fix this by accessing the ns structure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 7ae70eb5ef48e565427b416e22a1ccbed1e96120)

6 months agoMerge pull request #17127 from FRRouting/mergify/bp/dev/10.2/pr-17107
Donald Sharp [Wed, 16 Oct 2024 09:50:32 +0000 (05:50 -0400)]
Merge pull request #17127 from FRRouting/mergify/bp/dev/10.2/pr-17107

tests: iproute2_check_path_selection call the actual command (backport #17107)

6 months agozebra: unlock node only after operation in zebra_free_rnh()
Enke Chen [Tue, 15 Oct 2024 17:23:10 +0000 (10:23 -0700)]
zebra: unlock node only after operation in zebra_free_rnh()

Move route_unlock_node() after rnh_list_del().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 5b6ff51b8ae7f8c7348cea4de9543956f32641a7)

6 months agotests: iproute2_check_path_selection call the actual command
Donald Sharp [Tue, 15 Oct 2024 13:51:08 +0000 (09:51 -0400)]
tests: iproute2_check_path_selection call the actual command

For some reason this was missing.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit c8a947e12bbbcc16d6057975bf7c65661db2fc86)

6 months agoMerge pull request #17120 from FRRouting/mergify/bp/dev/10.2/pr-17088
Donald Sharp [Tue, 15 Oct 2024 21:55:22 +0000 (17:55 -0400)]
Merge pull request #17120 from FRRouting/mergify/bp/dev/10.2/pr-17088

zebra: Prevent a kernel route from being there when a connected should (backport #17088)

6 months agozebra: Prevent a kernel route from being there when a connected should
Donald Sharp [Mon, 14 Oct 2024 15:25:32 +0000 (11:25 -0400)]
zebra: Prevent a kernel route from being there when a connected should

There exists a series of events where a kernel route is learned
first( that happens to be exactly what a connected route should be )
and FRR ends up with both a kernel route and a connected route,
leaving us in a very strange spot.  This code change just mirrors
the existing code of if there is a connected route drop the kernel
route.  Here we just do the reverse, if we have a kernel route
already and a connected should be created, remove the kernel and
keep the connected.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 74e25198e74c4066b630515d2971c3c9381d70f2)

6 months agoMerge pull request #17108 from FRRouting/mergify/bp/dev/10.2/pr-17093
Donald Sharp [Tue, 15 Oct 2024 17:11:55 +0000 (13:11 -0400)]
Merge pull request #17108 from FRRouting/mergify/bp/dev/10.2/pr-17093

bgpd: fix route selection with AIGP (backport #17093)

6 months agotests: fix and adjust topotest/bgp_aigp
Enke Chen [Tue, 15 Oct 2024 01:47:59 +0000 (18:47 -0700)]
tests: fix and adjust topotest/bgp_aigp

Fix and adjust the topotest post the fix for route selection with
AIGP.

When there are multiple IGP domains (OSPF in this case), the nexthop
for a BGP route with the AIGP attribute must be resolved in its own
IGP domain.

The changes in r2/bgpd.conf and r3/bgpd.conf are needed as incorrect
IGP metrics are received from NHT for the recursive nexthops. Once
the issue is resolved, the changes can be reverted.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 1ee7e63a6c432662ef3a9a2bd0e1c41298bdf196)

6 months agobgpd: fix route selection with AIGP
Enke Chen [Tue, 15 Oct 2024 01:42:15 +0000 (18:42 -0700)]
bgpd: fix route selection with AIGP

The nexthop metric should be added to AIGP when calculating the
bestpath in bgp_path_info_cmp().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 081422e8e71085d3a3d4d2ff0bc1e1abaff0d52e)

6 months agoMerge pull request #17094 from FRRouting/mergify/bp/dev/10.2/pr-17074
Donatas Abraitis [Tue, 15 Oct 2024 07:50:30 +0000 (10:50 +0300)]
Merge pull request #17094 from FRRouting/mergify/bp/dev/10.2/pr-17074

bgpd: fix evpn mh esi down (backport #17074)

6 months agobgpd: fix evpn mh esi flap remove local routes
Chirag Shah [Tue, 8 Oct 2024 02:04:43 +0000 (19:04 -0700)]
bgpd: fix evpn mh esi flap remove local routes

In symmetric routing, when local ESI is down,
the MH peer learnt local mac-ip
prefix is installed into teannt vrf (given l3vni).

When ESI is back up and associated to evi/vni then
remove the local synced mac-ip imported routes from the
tenant vrf as local neigh/arp is present.

Ticket: #3878699
Testing:

peer advertised mac-ip route:
*> [2]:[0]:[48]:[aa:aa:aa:00:00:01]:[32]:[45.0.0.51] RD 27.0.0.4:9
                    27.0.0.4 (spine-1)
                                                           0 64435 65016 i
                    ESI:03:44:38:39:ff:ff:01:00:00:01
                    RT:65016:1000 RT:65016:4000 ET:8 Rmac:44:38:39:ff:ff:16

When local ESI is flapped
torm-11:# ip neigh show 45.0.0.51
45.0.0.51 dev vlan1000 lladdr aa:aa:aa:00:00:01 REACHABLE proto zebra

Before fix:
(The imported route remained in tenant-vrf)
torm-11:# ip route show vrf vrf1 45.0.0.51
45.0.0.51 nhid 257 proto bgp metric 20

After fix:

torm-11# ip route show vrf vrf1 45.0.0.51
torm-11#

trace:
2024/10/11 18:19:29 BGP: [JMP3T-178G8] route [2]:[0]:[48]:[00:02:00:00:00:08]:[32]:[21.1.0.5]
is matched on local esi 03:00:00:00:77:01:04:00:00:0e, uninstall from VRF tenant1 route table

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 3f00709a39ab2fe6f4bbae3d8f4b17baaab2e3dd)

6 months agoMerge pull request #17066 from FRRouting/mergify/bp/dev/10.2/pr-17059
Donald Sharp [Fri, 11 Oct 2024 16:14:53 +0000 (12:14 -0400)]
Merge pull request #17066 from FRRouting/mergify/bp/dev/10.2/pr-17059

bgpd: Move some non BGP-specific route-map functions to lib (backport #17059)

6 months agoMerge pull request #17063 from FRRouting/mergify/bp/dev/10.2/pr-17037
Donatas Abraitis [Fri, 11 Oct 2024 13:24:46 +0000 (16:24 +0300)]
Merge pull request #17063 from FRRouting/mergify/bp/dev/10.2/pr-17037

bgpd: fix ipv6 nexthop-local unchanged (backport #17037)

6 months agobgpd: Move some non BGP-specific route-map functions to lib
Donatas Abraitis [Thu, 10 Oct 2024 13:50:38 +0000 (16:50 +0300)]
bgpd: Move some non BGP-specific route-map functions to lib

They are managed under `frr-route-map`, not under `frr-bgp-route-map`.

Fixes: https://github.com/FRRouting/frr/issues/17055
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit b9a9be492e8dde39a0040bd1140893ccab83c2be)

6 months agotopotests: add bgp_nexthop_ipv6
Louis Scalbert [Tue, 8 Oct 2024 13:04:34 +0000 (15:04 +0200)]
topotests: add bgp_nexthop_ipv6

Add bgp_nexthop_ipv6 to check the ipv6 link-local nexthop conformity in
several situations.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 6dc4d9506181e370680283a4f9ec34d84b06d5e2)

6 months agobgpd: reset ipv6 invalid link-local nexthop
Louis Scalbert [Wed, 9 Oct 2024 15:08:44 +0000 (17:08 +0200)]
bgpd: reset ipv6 invalid link-local nexthop

If the "nexthop-local unchanged" setting is enabled, it preserves the
IPv6 link-local nexthop from the originating peer. However, if the
originating and destination peers are not on the same network segment,
the originating peer's IPv6 link-local address will be unreachable from
the destination peer.

In such cases, reset the IPv6 link-local nexthop, even if "nexthop-local
unchanged" is set on the destination peer.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 5bb99ccad2935adb006f7f727c2779b2c6e746e5)

6 months agobgpd: do not insert link-local with local unchanged
Louis Scalbert [Wed, 9 Oct 2024 15:06:19 +0000 (17:06 +0200)]
bgpd: do not insert link-local with local unchanged

Do not add an IPv6 link-local nexthop if the originating peer does not
provide one and the nexthop-local unchanged setting is enabled.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 34c1dd076e5f9ea2a7eb8820b204696dc692667d)

6 months agoRevert "bgpd: Exclude case for remote prefix w/o link-local"
Louis Scalbert [Tue, 8 Oct 2024 11:01:45 +0000 (13:01 +0200)]
Revert "bgpd: Exclude case for remote prefix w/o link-local"

This reverts commit 5f6a61f91fdbfa33df1b7112c961135156fbd894.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 38ad215feb313775e066c807a9a2bdf672d3c067)

6 months agoMerge pull request #17056 from FRRouting/mergify/bp/dev/10.2/pr-17054
Donatas Abraitis [Thu, 10 Oct 2024 16:10:34 +0000 (19:10 +0300)]
Merge pull request #17056 from FRRouting/mergify/bp/dev/10.2/pr-17054

tools: Add missing mgmtd into logrotate/rsyslogd (backport #17054)

6 months agotools: Add missing mgmtd into logrotate/rsyslogd
Donatas Abraitis [Thu, 10 Oct 2024 09:58:43 +0000 (12:58 +0300)]
tools: Add missing mgmtd into logrotate/rsyslogd

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit f57a56bca0093e52e6edce8a1829520f7f4f4fbb)

6 months agoMerge pull request #17048 from FRRouting/mergify/bp/dev/10.2/pr-17042
Donatas Abraitis [Thu, 10 Oct 2024 06:20:25 +0000 (09:20 +0300)]
Merge pull request #17048 from FRRouting/mergify/bp/dev/10.2/pr-17042

zebra: Fix crash in pw code (backport #17042)

6 months agozebra: Fix crash in pw code
Donald Sharp [Wed, 9 Oct 2024 11:16:37 +0000 (07:16 -0400)]
zebra: Fix crash in pw code

Recent PR #17009 introduced a crash in pw handing
for deletion.  Let's fix that problem.

Fixes: #17041
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 154a89bc31ab676bf8d037a37a98587ca0236ba9)

6 months agoMerge pull request #17023 from donaldsharp/dplane_problems base_10.2
Russ White [Tue, 8 Oct 2024 15:45:27 +0000 (11:45 -0400)]
Merge pull request #17023 from donaldsharp/dplane_problems

zebra: Allow dplane to pass larger number of nexthops down to dataplane

6 months agoMerge pull request #17009 from donaldsharp/pw_cleanup
Russ White [Tue, 8 Oct 2024 14:56:28 +0000 (10:56 -0400)]
Merge pull request #17009 from donaldsharp/pw_cleanup

Pw cleanup

6 months agoMerge pull request #16945 from opensourcerouting/fix/bgp_received-routes_with_soft_in...
Russ White [Tue, 8 Oct 2024 14:16:24 +0000 (10:16 -0400)]
Merge pull request #16945 from opensourcerouting/fix/bgp_received-routes_with_soft_inbound

bgpd: Show unmodified version of received-routes per neighbor

6 months agoMerge pull request #16942 from baozhen-H3C/202409271079
Russ White [Tue, 8 Oct 2024 14:15:19 +0000 (10:15 -0400)]
Merge pull request #16942 from baozhen-H3C/202409271079

TI-LFA incorrectly included pseudo-nodes when calculating PQ space.

6 months agoMerge pull request #16941 from opensourcerouting/fix/issue_16877
Russ White [Tue, 8 Oct 2024 14:14:30 +0000 (10:14 -0400)]
Merge pull request #16941 from opensourcerouting/fix/issue_16877

bgpd: Relax the same prefix and nexthop to be valid

6 months agoMerge pull request #17022 from opensourcerouting/vrrp-cmsg-next
Donald Sharp [Tue, 8 Oct 2024 13:31:18 +0000 (09:31 -0400)]
Merge pull request #17022 from opensourcerouting/vrrp-cmsg-next

vrrpd: iterate over all ancillary messages

6 months ago*: Allow 16 bit size for nexthops
Donald Sharp [Mon, 7 Oct 2024 16:40:46 +0000 (12:40 -0400)]
*: Allow 16 bit size for nexthops

Currently FRR is limiting the nexthop count to a uint8_t not a
uint16_t.  This leads to issues when the nexthop count is 256
which results in the count to overflow to 0 causing problems
in the code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agoMerge pull request #15903 from y-bharath14/srib-topotests-v1
Russ White [Tue, 8 Oct 2024 12:27:12 +0000 (08:27 -0400)]
Merge pull request #15903 from y-bharath14/srib-topotests-v1

tests: catch exception during switch shutdown

6 months agoMerge pull request #17014 from anlancs/fix/isisd-topo-check
Donatas Abraitis [Tue, 8 Oct 2024 05:10:22 +0000 (08:10 +0300)]
Merge pull request #17014 from anlancs/fix/isisd-topo-check

isisd: fix wrong check for MT commands

6 months agoMerge pull request #17024 from Jafaral/fix-autorp
Donatas Abraitis [Tue, 8 Oct 2024 05:03:52 +0000 (08:03 +0300)]
Merge pull request #17024 from Jafaral/fix-autorp

pimd: fix a possible crash when enabling debug autorp

6 months agozebra: Do not retry in 30 seconds on pw reachability failure
Donald Sharp [Fri, 4 Oct 2024 13:51:46 +0000 (09:51 -0400)]
zebra: Do not retry in 30 seconds on pw reachability failure

Currently the zebra pw code has setup a retry to install the
pw after 30 seconds when it is decided that reachability to
the pw is gone.  This causes a failure mode where the
pw code just goes and re-installs the pw after 30 seconds
in the non-reachability case.  Instead it should just be
reinstalling after reachability is restored.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agozebra: Move pw status settting until after we get results
Donald Sharp [Fri, 4 Oct 2024 13:38:25 +0000 (09:38 -0400)]
zebra: Move pw status settting until after we get results

Currently the pw code sets the status of the pw for install
and uninstall immediately when notifying the dplane.  This
is incorrect in that we do not actually know the status at
this point in time.  When we get the result is when to set
the status.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agopimd: fix a possible crash when enabling debug autorp
Jafar Al-Gharaibeh [Mon, 7 Oct 2024 23:20:34 +0000 (18:20 -0500)]
pimd: fix a possible crash when enabling debug autorp

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
6 months agoMerge pull request #17015 from LabNConsulting/chopps/load-internal-ietf-yang-library
Igor Ryzhov [Mon, 7 Oct 2024 17:33:23 +0000 (20:33 +0300)]
Merge pull request #17015 from LabNConsulting/chopps/load-internal-ietf-yang-library

lib: add flag to have libyang load internal ietf-yang-library module

6 months agovrrpd: iterate over all ancillary messages
Rafael Zalamena [Mon, 7 Oct 2024 16:02:44 +0000 (13:02 -0300)]
vrrpd: iterate over all ancillary messages

Assign the return of `CMSG_NXTHDR` so we can really iterate over the
ancillary data.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 months agoMerge pull request #17013 from dksharp5/removal_functions
Donatas Abraitis [Mon, 7 Oct 2024 08:47:01 +0000 (11:47 +0300)]
Merge pull request #17013 from dksharp5/removal_functions

Removal functions

6 months agoMerge pull request #17012 from dksharp5/remove_function
Donatas Abraitis [Mon, 7 Oct 2024 08:45:05 +0000 (11:45 +0300)]
Merge pull request #17012 from dksharp5/remove_function

zebra: remove unused function rib_lookup_ipv4

6 months agolib: add flag to have libyang load internal ietf-yang-library module
Christian Hopps [Mon, 7 Oct 2024 03:23:31 +0000 (03:23 +0000)]
lib: add flag to have libyang load internal ietf-yang-library module

Mgmtd makes use of libyang's internal ietf-yang-library module to add
support for said module to FRR management. Previously, mgmtd was loading
this module explicitly; however, that required that libyang's
`ietf-yang-library.yang` module definition file be co-located with FRR's
yang files so that it (and ietf-datastore.yang) would be found when
searched for by libyang using FRRs search path. This isn't always the
case depending on how the user compiles and installs libyang so mgmtd
was failing to run in some cases.

Instead of doing it the above way we simply tell libyang to load it's
internal version of ietf-yang-library when we initialize the libyang
context.

This required adding a boolean to a couple of the init functions which
is why so many files are touched (although all the changes are minimal).

Signed-off-by: Christian Hopps <chopps@labn.net>
6 months agoisisd: fix wrong check for MT commands
anlan_cs [Sun, 6 Oct 2024 13:06:15 +0000 (21:06 +0800)]
isisd: fix wrong check for MT commands

```
anlan# show run
!
interface eth0
 ip router isis A
exit
!
router isis A
 metric-style narrow <- NOT wide
exit
!
end
anlan (config)# int eth0
anlan (config-if)# no isis topology ipv6-unicast
% Configuration failed.

Error type: validation
Error description: Multi topology IS-IS can only be used with wide metrics
```

The MT commands are mainly controlled by the binded area, not by interface.
Currently if there is any MT configuration in the area, `metric-style` must
be with the `wide` mode, this requirement is sufficient.  So, the
unnecessary/wrong check for MT in the interface should be removed.

Signed-off-by: anlan_cs <anlan_cs@126.com>
6 months agolib,zebra: remove unused ZEBRA_VRF_UNREGISTER
Donna Sharp [Sun, 6 Oct 2024 23:40:49 +0000 (19:40 -0400)]
lib,zebra: remove unused ZEBRA_VRF_UNREGISTER

Signed-off-by: Donna Sharp <dksharp5@gmail.com>
6 months agozebra: remove unsued function from tc_netlink.c
Donna Sharp [Sun, 6 Oct 2024 23:30:56 +0000 (19:30 -0400)]
zebra: remove unsued function from tc_netlink.c

Signed-off-by: Donna Sharp <dksharp5@gmail.com>
6 months agozebra: remove unused function from if_netlink.c
Donna Sharp [Sun, 6 Oct 2024 23:25:44 +0000 (19:25 -0400)]
zebra: remove unused function from if_netlink.c

Signed-off-by: Donna Sharp <dksharp5@gmail.com>
6 months agozebra: remove unused function from tc_netlink.c
Donna Sharp [Sun, 6 Oct 2024 23:08:44 +0000 (19:08 -0400)]
zebra: remove unused function from tc_netlink.c

Signed-off-by: Donna Sharp <dksharp5@gmail.com>
6 months agozebra: remove unused function rib_lookup_ipv4
Donna Sharp [Sun, 6 Oct 2024 22:41:09 +0000 (18:41 -0400)]
zebra: remove unused function rib_lookup_ipv4

Signed-off-by: Donna Sharp <dksharp5@gmail.com>
6 months agoMerge pull request #17010 from anlancs/fix/tools-pim-interface-wrong-2
Donatas Abraitis [Sun, 6 Oct 2024 18:10:53 +0000 (21:10 +0300)]
Merge pull request #17010 from anlancs/fix/tools-pim-interface-wrong-2

tools: fix some special commands for reloading pim

6 months agotools: fix some special commands for reloading pim
anlan_cs [Sat, 5 Oct 2024 08:43:53 +0000 (16:43 +0800)]
tools: fix some special commands for reloading pim

The issue is we can't remove all pim configurations including some
special configurations (e.g., `no ip pim bsm`) for one interface.

For one pim-disable interface, all such pim depdendent options
(including `ip pim ` and `no ip pim `) should be completely removed.

Also append `no ip multicast` for the same purpose, it is no use at present,
but for future use.

The running config:
```
interface A
 ip pim
 no ip pim bsm
exit
```

Reload the new config:
```
interface A
exit
```

Before:
```
2024-10-05 20:52:33,467  INFO: Executed "interface A  no ip pim exit"
2024-10-05 20:52:33,482  INFO: Executed "interface A  ip pim bsm exit"
```
And the pim configurations in running configuration are not removed after reloading:
```
interface A
 ip pim <- Wrong
exit
```

After:
```
2024-10-05 20:56:27,489  INFO: Executed "interface A  no ip pim exit"
```
And all the pim configuration are removed.

Signed-off-by: anlan_cs <anlan_cs@126.com>
6 months agoMerge pull request #16800 from donaldsharp/nhg_reuse_intf_down_up
Russ White [Fri, 4 Oct 2024 14:28:58 +0000 (10:28 -0400)]
Merge pull request #16800 from donaldsharp/nhg_reuse_intf_down_up

Nhg reuse intf down up

6 months agoMerge pull request #17000 from fsb4000/patch-1
Donald Sharp [Fri, 4 Oct 2024 11:41:12 +0000 (07:41 -0400)]
Merge pull request #17000 from fsb4000/patch-1

zebra: Fix crash during reconnect

6 months agozebra: Fix crash during reconnect
Igor Zhukov [Fri, 4 Oct 2024 06:16:02 +0000 (13:16 +0700)]
zebra: Fix crash during reconnect

fpm_enqueue_rmac_table expects an fpm_rmac_arg* as its argument.

The issue can be reproduced by dropping the TCP session using:

ss -K dst 127.0.0.1 dport = 2620

I used Fedora 40 and frr 9.1.2 and I got the gdb backtrace:

(gdb) bt
0  0x00007fdd7d6997ea in fpm_enqueue_rmac_table (bucket=0x2134dd0, arg=0x2132b60) at zebra/dplane_fpm_nl.c:1217
1  0x00007fdd7dd1560d in hash_iterate (hash=0x21335f0, func=0x7fdd7d6997a0 <fpm_enqueue_rmac_table>, arg=0x2132b60) at lib/hash.c:252
2  0x00007fdd7dd1560d in hash_iterate (hash=0x1e5bf10, func=func@entry=0x7fdd7d698900 <fpm_enqueue_l3vni_table>,
    arg=arg@entry=0x7ffed983bef0) at lib/hash.c:252
3  0x00007fdd7d698b5c in fpm_rmac_send (t=<optimized out>) at zebra/dplane_fpm_nl.c:1262
4  0x00007fdd7dd6ce22 in event_call (thread=thread@entry=0x7ffed983c010) at lib/event.c:1970
5  0x00007fdd7dd20758 in frr_run (master=0x1d27f10) at lib/libfrr.c:1213
6  0x0000000000425588 in main (argc=10, argv=0x7ffed983c2e8) at zebra/main.c:492

Signed-off-by: Igor Zhukov <fsb4000@yandex.ru>
6 months agoMerge pull request #16994 from louis-6wind/bmp-adj-labels
Donald Sharp [Thu, 3 Oct 2024 19:08:36 +0000 (15:08 -0400)]
Merge pull request #16994 from louis-6wind/bmp-adj-labels

bgpd: export labels to pre-policy bmp

6 months agoMerge pull request #16993 from louis-6wind/bfd-no-variants
Donald Sharp [Thu, 3 Oct 2024 14:41:40 +0000 (10:41 -0400)]
Merge pull request #16993 from louis-6wind/bfd-no-variants

bfdd: add no variants to all configurations

6 months agobgpd: export labels to pre-policy bmp
Louis Scalbert [Tue, 27 Feb 2024 18:35:32 +0000 (19:35 +0100)]
bgpd: export labels to pre-policy bmp

Export labels to pre-policy BMP

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agoMerge pull request #16992 from sri-mohan1/srib-24-frr-a
Donald Sharp [Thu, 3 Oct 2024 13:34:00 +0000 (09:34 -0400)]
Merge pull request #16992 from sri-mohan1/srib-24-frr-a

bgpd: changes for code maintainability

6 months agoMerge pull request #16989 from opensourcerouting/fix/unreachable_code
Donald Sharp [Thu, 3 Oct 2024 12:29:55 +0000 (08:29 -0400)]
Merge pull request #16989 from opensourcerouting/fix/unreachable_code

bgpd: Print debug message about reaching maximum allowed multi paths

6 months agolib: remove unused bfd defines
Louis Scalbert [Thu, 3 Oct 2024 11:37:51 +0000 (13:37 +0200)]
lib: remove unused bfd defines

Remove unused bfd defines

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agobfdd: add no variants to all configurations
Louis Scalbert [Thu, 3 Oct 2024 11:08:43 +0000 (13:08 +0200)]
bfdd: add no variants to all configurations

Continue the work of b70835d690 ("bfdd: add no variants to interval
configurations")

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agobgpd: changes for code maintainability
sri-mohan1 [Thu, 3 Oct 2024 10:55:36 +0000 (16:25 +0530)]
bgpd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
6 months agobgpd: Print debug message about reaching maximum allowed multi paths
Donatas Abraitis [Thu, 3 Oct 2024 06:20:40 +0000 (09:20 +0300)]
bgpd: Print debug message about reaching maximum allowed multi paths

Fixes: 421cf856ef86db250a86be01437d0a668b463dcc ("bgpd: Cleanup multipath figuring out in bgp")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agoMerge pull request #16978 from donaldsharp/dmed_deselect_not_used
Donatas Abraitis [Thu, 3 Oct 2024 04:05:13 +0000 (07:05 +0300)]
Merge pull request #16978 from donaldsharp/dmed_deselect_not_used

bgpd: Remove unused bgp_mp_dmed_deselect function

6 months agoMerge pull request #16977 from louis-6wind/fix-printfrr_bp
Donatas Abraitis [Wed, 2 Oct 2024 15:57:59 +0000 (18:57 +0300)]
Merge pull request #16977 from louis-6wind/fix-printfrr_bp

bgpd: fix printfrr_bp for non initialized peers

6 months agoMerge pull request #16971 from opensourcerouting/fix/v6-with-v4-nexthops
Donald Sharp [Wed, 2 Oct 2024 15:08:13 +0000 (11:08 -0400)]
Merge pull request #16971 from opensourcerouting/fix/v6-with-v4-nexthops

bgpd: Actually make ` --v6-with-v4-nexthops` it work

6 months agobgpd: Remove unused bgp_mp_dmed_deselect function
Donald Sharp [Wed, 2 Oct 2024 14:41:37 +0000 (10:41 -0400)]
bgpd: Remove unused bgp_mp_dmed_deselect function

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agoMerge pull request #16967 from donaldsharp/nexthop_fixes
Donatas Abraitis [Wed, 2 Oct 2024 13:10:34 +0000 (16:10 +0300)]
Merge pull request #16967 from donaldsharp/nexthop_fixes

lib: nexthop code should use uint16_t for nexthop counting

6 months agobgpd: fix printfrr_bp for non initialized peers
Louis Scalbert [Wed, 2 Oct 2024 12:38:15 +0000 (14:38 +0200)]
bgpd: fix printfrr_bp for non initialized peers

Fix printfrr_bp for non initialized peers. For example:

> Sep 26 17:56:44 r1 bgpd[26295]: [GJPH1-W8PZV] Resetting peer (null)(Unknown) due to change in addpath config

Is now:

> Oct 02 14:00:59 r1 bgpd[12795]: [MNE5N-K0G4Z] Resetting peer 2.2.2.2 due to change in addpath config

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agoMerge pull request #16968 from opensourcerouting/bfd-no-commands
Donald Sharp [Wed, 2 Oct 2024 12:40:14 +0000 (08:40 -0400)]
Merge pull request #16968 from opensourcerouting/bfd-no-commands

bfdd: add no variants to interval configurations

6 months agoMerge pull request #16961 from donaldsharp/mp_info_changes
Donatas Abraitis [Wed, 2 Oct 2024 11:53:04 +0000 (14:53 +0300)]
Merge pull request #16961 from donaldsharp/mp_info_changes

Mp info changes

6 months agobgpd: Actually make ` --v6-with-v4-nexthops` it work
Donatas Abraitis [Wed, 2 Oct 2024 10:57:30 +0000 (13:57 +0300)]
bgpd: Actually make ` --v6-with-v4-nexthops` it work

It was using `-v` which is actually a _version_.

Fixes: 0435b31bb8ed55377f83d0e19bc085abc3c71b44 ("bgpd: Allow bgp to specify if it will allow v6 routing with v4 nexthops")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobfdd: add no variants to interval configurations
Rafael Zalamena [Tue, 1 Oct 2024 21:58:24 +0000 (18:58 -0300)]
bfdd: add no variants to interval configurations

Add missing no commands to various interval configurations.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 months agolib: nexthop code should use uint16_t for nexthop counting
Donald Sharp [Tue, 1 Oct 2024 18:31:08 +0000 (14:31 -0400)]
lib: nexthop code should use uint16_t for nexthop counting

It's possible to specify via the cli and configure how many
nexthops that are allowed on the system.  If you happen to
have > 255 then things are about to get interesting otherwise.

Let's allow up to 65k nexthops (ha!)

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agoMerge pull request #16952 from anlancs/fix/tools-pim-interface-wrong
Jafar Al-Gharaibeh [Tue, 1 Oct 2024 19:30:35 +0000 (14:30 -0500)]
Merge pull request #16952 from anlancs/fix/tools-pim-interface-wrong

tools: fix missing check interfaces for reloading pim

6 months agoMerge pull request #16955 from anlancs/fix/pimd-add-v4v6-check
Jafar Al-Gharaibeh [Tue, 1 Oct 2024 19:28:28 +0000 (14:28 -0500)]
Merge pull request #16955 from anlancs/fix/pimd-add-v4v6-check

pimd: fix missing IPV4 check

6 months agotests: Check if loopback routes are considered valid for nexthop tracking
Donatas Abraitis [Fri, 27 Sep 2024 07:52:22 +0000 (10:52 +0300)]
tests: Check if loopback routes are considered valid for nexthop tracking

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Relax the same prefix and nexthop to be valid
Donatas Abraitis [Fri, 27 Sep 2024 07:52:55 +0000 (10:52 +0300)]
bgpd: Relax the same prefix and nexthop to be valid

Treat as next-hop invalid if import check is enabled.

Fixes: 654a5978f695087af062bfc9a382321fa2ccc4ae ("bgpd: prevent routes loop through itself")
Fixes: https://github.com/FRRouting/frr/issues/16877
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agotests: Drop test_bgp_with_loopback_with_same_subnet_p1
Donatas Abraitis [Fri, 27 Sep 2024 09:55:39 +0000 (12:55 +0300)]
tests: Drop test_bgp_with_loopback_with_same_subnet_p1

It's replaced and simplified by c3fd1e9520c619babb3004cea6df622ca67b0dfa.

JSON topo is just horrible to debug.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Remove bgp_path_info_mpath_dequeue
Donald Sharp [Tue, 1 Oct 2024 13:18:44 +0000 (09:18 -0400)]
bgpd: Remove bgp_path_info_mpath_dequeue

This function is no doing any work.  Let's remove.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agobgpd: Cleanup multipath figuring out in bgp
Donald Sharp [Mon, 30 Sep 2024 19:09:42 +0000 (15:09 -0400)]
bgpd: Cleanup multipath figuring out in bgp

Currently bgp multipath has these properties:

a) mp_info may or may not be on a single path, based
upon path perturbations in the past.
b) mp_info->count started counting at 0( meaning 1 ).  As that the
bestpath path_info was never included in the count
c) The first mp_info in the list held the multipath data associated
with the multipath.  As such if you were at any other node that data
was not filled in.
d) As such the mp_info's that are not first on the list basically
were just pointers to the corresponding bgp_path_info that was in
the multipath.
e) On bestpath calculation, a linklist(struct linklist *) of bgp_path_info's was
created.
f) This linklist was passed in to a comparison function that took the
old mpinfo list and compared it item by item to the linklist and
doing magic to figure out how to create a new mp_info list.
g) the old mp_info and the link list had to be memory managed and
freed up.
h) BGP_PATH_MULTIPATH is only set on non bestpath nodes in the
multipath.

This is really complicated.  Let's change the algorithm to this:

a) When running bestpath, mark a bgp_path_info node that could be in the ecmp path as
BGP_PATH_MULTIPATH_NEW.
b) When running multipath, just walk the list of bgp_path_info's and if
it has BGP_PATH_MULTIPATH_NEW on it, decide if it is in BGP_MULTIPATH.
If we run out of space to put in the ecmp, clear the flag on the rest.
c) Clean up the counting of sometimes adding 1 to the mpath count.
d) Only allocate a mpath_info node for the bestpath.  Clean it up
when done with it.
e) remove the unneeded list management associated with the linklist and
the mp_list.

This greatly simplifies multipath computation for bgp and reduces memory
load for large scale deployments.

2 full feeds in work_queue_run prior:

    0      56367.471      1123    50193    493695    50362    493791         0         0          0    TE   work_queue_run

BGP multipath info            :  1941844     48   110780992  1941844 110780992

2 full feeds in work_queue_run after change:

    1      52924.931      1296    40837    465968    41025    487390         0         0          1    TE   work_queue_run

BGP multipath info            :   970860     32    38836880   970866  38837120

Aproximately 4 seconds of saved cpu time for convergence and ~75 mb
smaller run time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agotests: Clean up some logging in test_bgp_default_originate_2links.py
Donald Sharp [Mon, 30 Sep 2024 18:57:45 +0000 (14:57 -0400)]
tests: Clean up some logging in test_bgp_default_originate_2links.py

Test was confusing.  Add some useful data and clean up some debugs

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agobgpd: Ensure mpath data is only on bestpath
Donald Sharp [Thu, 26 Sep 2024 14:46:23 +0000 (10:46 -0400)]
bgpd: Ensure mpath data is only on bestpath

The mpath data structure has data that is only relevant
for the first mpath in the list.  It is not being used
anywhere else.  Let's document that a bit more.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agobgpd: Use CHECK_FLAG to remain consistent for mp_flags
Donald Sharp [Thu, 26 Sep 2024 14:40:30 +0000 (10:40 -0400)]
bgpd: Use CHECK_FLAG to remain consistent for mp_flags

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agoMerge pull request #16958 from opensourcerouting/calloc-warning-fix
Jafar Al-Gharaibeh [Mon, 30 Sep 2024 17:42:12 +0000 (12:42 -0500)]
Merge pull request #16958 from opensourcerouting/calloc-warning-fix

lib: fix calloc warning on recent compiler

6 months agoMerge pull request #16957 from opensourcerouting/pim-fixes
Jafar Al-Gharaibeh [Mon, 30 Sep 2024 17:07:50 +0000 (12:07 -0500)]
Merge pull request #16957 from opensourcerouting/pim-fixes

pimd: miscellaneous fixes

6 months agoMerge pull request #16938 from btrent98/autorp-topotest
Rafael Zalamena [Mon, 30 Sep 2024 15:49:05 +0000 (12:49 -0300)]
Merge pull request #16938 from btrent98/autorp-topotest

pimd: enhance topotest of autorp, fix autorp cli bug

6 months agolib: fix calloc warning on recent compiler
Rafael Zalamena [Mon, 30 Sep 2024 14:31:56 +0000 (11:31 -0300)]
lib: fix calloc warning on recent compiler

Fix the following compiler warning:
```
lib/elf_py.c: In function _elffile_load_:
lib/elf_py.c:1310:34: warning: _calloc_ sizes specified with _sizeof_ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
 1310 |         w->sects = calloc(sizeof(PyObject *), w->ehdr->e_shnum);
      |                                  ^~~~~~~~
lib/elf_py.c:1310:34: note: earlier argument should specify number of elements, later size of each element
```

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 months agopimd: fix northbound error message on delete
Rafael Zalamena [Thu, 1 Aug 2024 01:16:54 +0000 (22:16 -0300)]
pimd: fix northbound error message on delete

`snprintf` doesn't know about `%pPAs` use `snprintfrr` instead.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 months agopimd: remove unreachable code
Rafael Zalamena [Mon, 5 Aug 2024 17:36:18 +0000 (14:36 -0300)]
pimd: remove unreachable code

MLD code is IPv6 only so the define `PIM_IPV` will never be 4.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 months agopimd: fix missing IPV4 check
anlan_cs [Mon, 30 Sep 2024 05:06:26 +0000 (13:06 +0800)]
pimd: fix missing IPV4 check

In `pim_if_addr_add()`, some code inside `PIM_IPV == 4`
( the case of `igmp->mtrace_only` ) wrongly accepts ipv6 address.

So, clearly add IPV4 check.

Signed-off-by: anlan_cs <anlan_cs@126.com>
7 months agotools: fix missing check interfaces for reloading pim
anlan_cs [Sun, 29 Sep 2024 02:15:31 +0000 (10:15 +0800)]
tools: fix missing check interfaces for reloading pim

Without checking interfaces, the other interfaces' changes will be wrongly
lost.

Running config:
```
interface A
ip pim
ip pim use-source 11.0.0.1
exit
!
interface B
ip pim
ip pim use-source 22.0.0.1
exit
!
```

Reload the new config:
```
interface A
exit
!
interface B
ip pim
exit
```

Before:
```
2024-09-29 10:08:27,686  INFO: Executed "interface A  no ip pim exit"
```

After:
```
2024-09-29 10:05:01,356  INFO: Executed "interface A  no ip pim exit"
2024-09-29 10:05:01,376  INFO: Executed "interface B  no ip pim use-source 22.0.0.1 exit"
```

Signed-off-by: anlan_cs <anlan_cs@126.com>
7 months agotests: enhance autorp topotest
Barry A. Trent [Fri, 27 Sep 2024 19:59:12 +0000 (12:59 -0700)]
tests: enhance autorp topotest

Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
7 months agopimd: fix autorp CLI bugs
Barry A. Trent [Thu, 26 Sep 2024 21:49:19 +0000 (14:49 -0700)]
pimd: fix autorp CLI bugs

Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
7 months agotests: Check if we can see unmodified received-routes with soft inbound
Donatas Abraitis [Fri, 27 Sep 2024 11:04:59 +0000 (14:04 +0300)]
tests: Check if we can see unmodified received-routes with soft inbound

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
7 months agobgpd: Show unmodified version of received-routes per neighbor
Donatas Abraitis [Fri, 27 Sep 2024 10:59:42 +0000 (13:59 +0300)]
bgpd: Show unmodified version of received-routes per neighbor

If we have soft inbound enabled, we should see how the route looks like
before it was modified by a route-map/prefix-list.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
7 months agoisisd: Fix the PQ space computation error in TI-LFA
b29332 [Fri, 27 Sep 2024 07:51:17 +0000 (15:51 +0800)]
isisd: Fix the PQ space computation error in TI-LFA

When there are pseudo-nodes on the device, during TI-LFA calculation of PQ space, even if this IS vertex is not originally a P/Q node, it might be calculated as a P/Q node due to the presence of pseudo-nodes, causing this IS vertex to become a P/Q node.

Signed-off-by: baozhen-H3C <bao.zhen@h3c.com>
7 months agoMerge pull request #16939 from sri-mohan1/srib-24-frr-a
Donatas Abraitis [Fri, 27 Sep 2024 05:53:38 +0000 (08:53 +0300)]
Merge pull request #16939 from sri-mohan1/srib-24-frr-a

bgpd: changes for code maintainability

7 months agoMerge pull request #16934 from donaldsharp/clang_format
Donatas Abraitis [Fri, 27 Sep 2024 05:49:31 +0000 (08:49 +0300)]
Merge pull request #16934 from donaldsharp/clang_format

*: Modify clang-format column limit to 100