]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
5 weeks agotests: add another directory to search path for pylint
Christian Hopps [Mon, 24 Mar 2025 05:07:28 +0000 (05:07 +0000)]
tests: add another directory to search path for pylint

Some IDEs (e.g., emacs+lsp) run pylint from the root directory and so
we need to add `tests/topotests` so that `lib` and `munet` are found
by pylint when used in imports

Signed-off-by: Christian Hopps <chopps@labn.net>
6 weeks agoMerge pull request #18399 from LabNConsulting/chopps/fix-unit-tests
Donatas Abraitis [Sun, 16 Mar 2025 14:14:55 +0000 (15:14 +0100)]
Merge pull request #18399 from LabNConsulting/chopps/fix-unit-tests

2 unit-test fixes

6 weeks agoMerge pull request #18384 from LabNConsulting/chopps/suppress-expected-libyang-error-log
Donatas Abraitis [Sun, 16 Mar 2025 14:12:59 +0000 (15:12 +0100)]
Merge pull request #18384 from LabNConsulting/chopps/suppress-expected-libyang-error-log

lib: suppress libyang logs during expected error result

6 weeks agoMerge pull request #18387 from Manpreet-k0/redo_import_check_crash
Donatas Abraitis [Sat, 15 Mar 2025 17:35:04 +0000 (18:35 +0100)]
Merge pull request #18387 from Manpreet-k0/redo_import_check_crash

bgpd: Fixed crash upon bgp network import-check command

6 weeks agoMerge pull request #18394 from donaldsharp/fpm_listener_output
Donatas Abraitis [Sat, 15 Mar 2025 17:32:19 +0000 (18:32 +0100)]
Merge pull request #18394 from donaldsharp/fpm_listener_output

zebra: add ability to specify output file with fpm_listener

6 weeks agoMerge pull request #18395 from donaldsharp/bgp_stream_copy_usage_removal
Donatas Abraitis [Sat, 15 Mar 2025 17:31:41 +0000 (18:31 +0100)]
Merge pull request #18395 from donaldsharp/bgp_stream_copy_usage_removal

bgpd: Remove unnecessary stream_new/stream_copies in bgp_open_make

6 weeks agoMerge pull request #18393 from LabNConsulting/aceelindem/ospf6-area-no-config-delete...
Donatas Abraitis [Sat, 15 Mar 2025 13:15:58 +0000 (14:15 +0100)]
Merge pull request #18393 from LabNConsulting/aceelindem/ospf6-area-no-config-delete-stale

ospf6d: Disable and delete OSPFv3 areas that no longer have interfaces or configuration.

6 weeks agotests: fix wrong callback function parameters in unit-test
Christian Hopps [Sat, 15 Mar 2025 04:10:24 +0000 (04:10 +0000)]
tests: fix wrong callback function parameters in unit-test

Signed-off-by: Christian Hopps <chopps@labn.net>
6 weeks agotests: deal with configure overridden timestamp prec in unit test
Christian Hopps [Sat, 15 Mar 2025 04:09:29 +0000 (04:09 +0000)]
tests: deal with configure overridden timestamp prec in unit test

Previously if you configured a different timestamp precision then
`make check` would fail as the non-default config is generated and
fails test_cli config file comparison.

Signed-off-by: Christian Hopps <chopps@labn.net>
6 weeks agobgpd: Remove unnecessary stream_new/stream_copies in bgp_open_make
Donald Sharp [Fri, 14 Mar 2025 18:50:59 +0000 (14:50 -0400)]
bgpd: Remove unnecessary stream_new/stream_copies in bgp_open_make

The call into bgp_open_capability can return that it wrote more
than BGP_OPEN_NON_EXT_OPT_LEN bytes, in that case the open
part needs to be written again with ext_opt_params set to
true to allow extended parameters to be written thus keeping
the len < 255 bytes.  The code to do this was first creating
a new stream and then copying into it the stream, trying
to call bgp_open_capability() and if it succeeded recopying
the tmp stream back onto the original.

Let's change this around such that we save the current spot
in the stream of where we are writing and if the change does
not work reset the pointer and try again with the correct
parameter.  This removes the stream and multiple copies and
eventual free of the temporary stream.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 weeks agozebra: add ability to specify output file with fpm_listener
Donald Sharp [Fri, 14 Mar 2025 17:22:16 +0000 (13:22 -0400)]
zebra: add ability to specify output file with fpm_listener

The fpm_listener didn't have the ability to specify the output
file location at all.  Modify the code to accept this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 weeks ago ospf6d: Disable and delete OSPFv3 areas that no longer have interfaces or configur...
Acee Lindem [Fri, 14 Mar 2025 16:02:28 +0000 (16:02 +0000)]
   ospf6d: Disable and delete OSPFv3 areas that no longer have interfaces or configuration.

        This fix will delete an OSPFv3 area when all the interfaces and
        configuration (ranges, NSSA ranges, stub area, NSSA area, filter-list,
        import-list and export-list) have been removed. The changes provides
        a general solution to https://github.com/FRRouting/frr/issues/18324.

Signed-off-by: Acee Lindem <acee@lindem.com>
6 weeks agoMerge pull request #18360 from raja-rajasekar/rajasekarr/fix_explicit_sid_allocation
Jafar Al-Gharaibeh [Fri, 14 Mar 2025 14:57:41 +0000 (09:57 -0500)]
Merge pull request #18360 from raja-rajasekar/rajasekarr/fix_explicit_sid_allocation

zebra: ensure proper return for failure for Sid allocation

6 weeks agolib: suppress libyang logs during expected error result.
Christian Hopps [Fri, 14 Mar 2025 05:19:10 +0000 (05:19 +0000)]
lib: suppress libyang logs during expected error result.

Signed-off-by: Christian Hopps <chopps@labn.net>
6 weeks agolib: northbound: also log debugs for new get callback
Christian Hopps [Thu, 30 Jan 2025 00:54:33 +0000 (00:54 +0000)]
lib: northbound: also log debugs for new get callback

Signed-off-by: Christian Hopps <chopps@labn.net>
6 weeks agoMerge pull request #18383 from LabNConsulting/chopps/fix-oper-state-list-query-bug
Donald Sharp [Fri, 14 Mar 2025 14:33:16 +0000 (10:33 -0400)]
Merge pull request #18383 from LabNConsulting/chopps/fix-oper-state-list-query-bug

Fix bug with oper-state queries including list node

6 weeks agoMerge pull request #18377 from kaffarell/master
Donald Sharp [Fri, 14 Mar 2025 13:43:09 +0000 (09:43 -0400)]
Merge pull request #18377 from kaffarell/master

isisd: fix bit flag collision in options field

6 weeks agoMerge pull request #18388 from y-bharath14/srib-yang-v5
Donald Sharp [Fri, 14 Mar 2025 13:41:39 +0000 (09:41 -0400)]
Merge pull request #18388 from y-bharath14/srib-yang-v5

yang: Fixed pyang errors at frr-bgp-common.yang

6 weeks agobgpd: Fixed crash upon bgp network import-check command
Manpreet Kaur [Thu, 13 Mar 2025 11:14:24 +0000 (04:14 -0700)]
bgpd: Fixed crash upon bgp network import-check command

BT:
```
3  <signal handler called>
4  0x00005616837546fc in bgp_static_update (bgp=bgp@entry=0x5616865eac50, p=0x561686639e40,
    bgp_static=0x561686639f50, afi=afi@entry=AFI_IP6, safi=safi@entry=SAFI_UNICAST) at ../bgpd/bgp_route.c:7232
5  0x0000561683754ad0 in bgp_static_add (bgp=0x5616865eac50) at ../bgpd/bgp_table.h:413
6  0x0000561683785e2e in no_bgp_network_import_check (self=<optimized out>, vty=0x5616865e04c0,
    argc=<optimized out>, argv=<optimized out>) at ../bgpd/bgp_vty.c:4609
7  0x00007fdbcc294820 in cmd_execute_command_real (vline=vline@entry=0x561686663000,
```

The program encountered a SEG FAULT when attempting to access pi->extra->vrfleak->bgp_orig because
pi->extra->vrfleak was NULL.
```
(gdb) p pi->extra->vrfleak
$1 = (struct bgp_path_info_extra_vrfleak *) 0x0
(gdb) p pi->extra->vrfleak->bgp_orig
Cannot access memory at address 0x8
```
Added NOT NULL check on pi->extra->vrfleak before accessing pi->extra->vrfleak->bgp_orig
to prevent the segmentation fault.

Signed-off-by: Manpreet Kaur <manpreetk@nvidia.com>
6 weeks agoyang: Fixed pyang errors at frr-bgp-common.yang
Y Bharath [Fri, 14 Mar 2025 09:01:52 +0000 (14:31 +0530)]
yang: Fixed pyang errors at frr-bgp-common.yang

Fixed pyang errors at frr-bgp-common.yang

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
6 weeks agolib: make sure we update the darr_strlen from pruned string.
Christian Hopps [Fri, 14 Mar 2025 05:54:28 +0000 (05:54 +0000)]
lib: make sure we update the darr_strlen from pruned string.

This fixes a bug when handling of queries which include list nodes in
the xpath.

Signed-off-by: Christian Hopps <chopps@labn.net>
6 weeks agolib: add `darr_strlen_fixup()` to update len based on NUL term
Christian Hopps [Thu, 13 Mar 2025 20:32:59 +0000 (20:32 +0000)]
lib: add `darr_strlen_fixup()` to update len based on NUL term

Signed-off-by: Christian Hopps <chopps@labn.net>
6 weeks agoMerge pull request #18380 from donaldsharp/non_peer_group
Donatas Abraitis [Fri, 14 Mar 2025 06:30:52 +0000 (07:30 +0100)]
Merge pull request #18380 from donaldsharp/non_peer_group

bgpd: Show bgp <afi> <safi> shouldn't display peers in groups

6 weeks agobgpd: Show bgp <afi> <safi> shouldn't display peers in groups
Donald Sharp [Thu, 13 Mar 2025 19:19:02 +0000 (15:19 -0400)]
bgpd: Show bgp <afi> <safi> shouldn't display peers in groups

The command `show bgp <afi> <safi>` has this output:

r1# show bgp ipv4 uni 10.0.0.0
BGP routing table entry for 10.0.0.0/32, version 1
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  r1-eth0 r1-eth1 r1-eth2 r1-eth3
  ....

It specifically states `Advertised to non peer-group peers:` yet
the code is not filtering those out.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 weeks agoisisd: fix bit flag collision in options field
Gabriel Goller [Thu, 13 Mar 2025 11:11:34 +0000 (12:11 +0100)]
isisd: fix bit flag collision in options field

Resolve conflict between F_ISIS_UNIT_TEST and ISIS_OPT_DUMMY_AS_LOOPBACK
which were both using the same bit value (0x01). This collision caused
unit test mode to be unintentionally enabled when DUMMY_AS_LOOPBACK was set.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
6 weeks agoMerge pull request #18366 from pguibert6WIND/community_limit_zero_add_test
Donatas Abraitis [Wed, 12 Mar 2025 20:47:17 +0000 (21:47 +0100)]
Merge pull request #18366 from pguibert6WIND/community_limit_zero_add_test

Add Testing for community and Extended community match limit zero

6 weeks agoMerge pull request #18367 from donaldsharp/static_nexthop_reinstall
Jafar Al-Gharaibeh [Wed, 12 Mar 2025 15:30:13 +0000 (10:30 -0500)]
Merge pull request #18367 from donaldsharp/static_nexthop_reinstall

staticd: Install known nexthops upon connection with zebra

6 weeks agoMerge pull request #18368 from donaldsharp/backout_bgp_if_up_down_changes
Jafar Al-Gharaibeh [Wed, 12 Mar 2025 15:29:11 +0000 (10:29 -0500)]
Merge pull request #18368 from donaldsharp/backout_bgp_if_up_down_changes

Revert "bgpd: upon if event, evaluate bnc with matching nexthop"

6 weeks agoRevert "bgpd: upon if event, evaluate bnc with matching nexthop"
Donald Sharp [Wed, 12 Mar 2025 13:01:52 +0000 (09:01 -0400)]
Revert "bgpd: upon if event, evaluate bnc with matching nexthop"

This reverts commit 58592be57783a3b24e7351af2a5afc61299768df.

This commit is being reverted because of several issues:

a) tcpdump -i <any interface that bgp happens to use>

This command causes bgp to dump it's entire table to all
of it's peers again.  This is a huge problem in any type
of scaled environment *and* it is not unusual to have an
operator do this.

b) This commit appears to be attempting to solve the problem
with route leaking across vrf's using labels( or somesuch ).
Unfortunately we have absolutely no topotests that show the
behavior.  I am also unable to get any type of how to reproduce
the problem being solved by the commit.  I do know, though,
that the problem really stems from the fact that bgp has
decided to cheat and not create bnc's for route leaking.
Thus when a nexthop changes, bgp is not being notified.
This commit was being used as a hammer to solve the problem.

While I do agree backing out a bug fix for some operator
is less then ideal, I believe that since I cannot get the
operator to tell me the problem it solved and the fact
that sending large amounts of updates with just a simple
tcpdump command ( actually 2 one for tcpdump start and
one for finishing ) is more detrimental in my eyes at
this point in time.  Additionally the solution used
is the wrong one for the problem.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 weeks agostaticd: Install known nexthops upon connection with zebra
Donald Sharp [Wed, 12 Mar 2025 12:30:43 +0000 (08:30 -0400)]
staticd: Install known nexthops upon connection with zebra

CI tests are showing cases where staticd is connecting to
zebra after config is read in and the nexthops are never
being registered w/ zebra:

2025/03/11 15:39:44 STATIC: [T83RR-8SM5G] staticd 10.4-dev starting: vty@2616
2025/03/11 15:39:45 STATIC: [GH3PB-C7X4Y] Static Route to 13.13.13.13/32 not installed currently because dependent config not fully available
2025/03/11 15:39:45 STATIC: [RHJK1-M5FAR] static_zebra_nht_register: Failure to send nexthop 1.1.1.2/32 for 11.11.11.11/32 to zebra
2025/03/11 15:39:45 STATIC: [M7Q4P-46WDR] vty[14]@> enable

Zebra shows connection time as:

2025/03/11 15:39:45.933343 ZEBRA: [V98V0-MTWPF] client 5 says hello and bids fair to announce only static routes vrf=0

As a result staticd never installs the route because it has no nexthop
tracking to say that the route could be installed.

Modify staticd on startup to go through it's nexthops and dump them to
zebra to allow the staticd state machine to get to work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 weeks agoMerge pull request #18336 from routingrocks/rvaratharaj/bugfixmar
Mark Stapp [Wed, 12 Mar 2025 12:09:29 +0000 (08:09 -0400)]
Merge pull request #18336 from routingrocks/rvaratharaj/bugfixmar

zebra: Fix neigh delete causing heap-use-after-free error

7 weeks agozebra: Fix neigh delete causing heap-use-after-free error
Rajesh Varatharaj [Fri, 7 Mar 2025 00:57:18 +0000 (16:57 -0800)]
zebra: Fix neigh delete causing heap-use-after-free error

Issue:
Not freeing the neighbor n  within the same function can lead to
memory leak.
zebra_neigh_del_all() -> zebra_neigh_del() re lookup and free

Fix: not accessing n after its freed.
Directly free the neighbor entry (n) when its interface index matches
ifp->ifindex.

This fixes:
ERROR: AddressSanitizer: heap-use-after-free on address 0x6070001052e8 at pc 0x7f6bf7d09ddb bp 0x7ffd3366a000 sp 0x7ffd33669ff0
READ of size 8 at 0x6070001052e8 thread T0
    #0 0x7f6bf7d09dda in _rb_next lib/openbsd-tree.c:455
    #1 0x55f95a307261 in zebra_neigh_rb_head_RB_NEXT zebra/zebra_neigh.h:34
    #2 0x55f95a3082e9 in zebra_neigh_del_all zebra/zebra_neigh.c:162
    #3 0x55f95a121ee7 in zebra_interface_down_update zebra/redistribute.c:571
    #4 0x55f95a0f819d in if_down zebra/interface.c:1017
    #5 0x55f95a0fe168 in zebra_if_dplane_ifp_handling zebra/interface.c:2102
    #6 0x55f95a0ff10c in zebra_if_dplane_result zebra/interface.c:2241
    #7 0x55f95a27ce9c in rib_process_dplane_results zebra/zebra_rib.c:5015
    #8 0x7f6bf7da3ad9 in event_call lib/event.c:1984
    #9 0x7f6bf7c62141 in frr_run lib/libfrr.c:1246
    #10 0x55f95a11ca7f in main zebra/main.c:543
    #11 0x7f6bf7029d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #12 0x7f6bf7029e3f in __libc_start_main_impl ../csu/libc-start.c:392
    #13 0x55f95a0dd0b4 in _start (/usr/lib/frr/zebra+0x1a80b4)

Ticket: #18047

Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
7 weeks agoMerge pull request #16614 from louis-6wind/fix-otable-heap-after-free
Mark Stapp [Tue, 11 Mar 2025 18:03:14 +0000 (14:03 -0400)]
Merge pull request #16614 from louis-6wind/fix-otable-heap-after-free

zebra: fix table heap-after-free crash

7 weeks agotopotests: check when extended community-limit is set to 0
Philippe Guibert [Tue, 11 Mar 2025 16:33:49 +0000 (17:33 +0100)]
topotests: check when extended community-limit is set to 0

Add a test to control that when the extended community limit is set
to 0, then only 2 BGP updates are received on R3.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 weeks agotopotests: check when community-limit is set to 0
Philippe Guibert [Tue, 11 Mar 2025 16:29:22 +0000 (17:29 +0100)]
topotests: check when community-limit is set to 0

Add a test to control that when the community limit is set to 0, then
only 2 BGP updates are received on R3.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 weeks agoMerge pull request #18362 from y-bharath14/srib-tests-v4
Russ White [Tue, 11 Mar 2025 15:26:12 +0000 (11:26 -0400)]
Merge pull request #18362 from y-bharath14/srib-tests-v4

tests: Fixed NameError at bmpserver.py

7 weeks agoMerge pull request #18346 from donaldsharp/memory_leaks_bgp
Russ White [Tue, 11 Mar 2025 14:35:14 +0000 (10:35 -0400)]
Merge pull request #18346 from donaldsharp/memory_leaks_bgp

Clean up some code and bad assumptions in zebra

7 weeks agoMerge pull request #18342 from anlancs/ospfd-minor-change
Russ White [Tue, 11 Mar 2025 14:33:41 +0000 (10:33 -0400)]
Merge pull request #18342 from anlancs/ospfd-minor-change

ospfd: minor change for style

7 weeks agotests: Fixed NameError at bmpserver.py
Y Bharath [Tue, 11 Mar 2025 06:03:33 +0000 (11:33 +0530)]
tests: Fixed NameError at bmpserver.py

Fixed NameError at bmpserver.py

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
7 weeks agozebra: ensure proper return for failure for Sid allocation
Rajasekar Raja [Mon, 10 Mar 2025 22:26:38 +0000 (15:26 -0700)]
zebra: ensure proper return for failure for Sid allocation

The functions alloc_srv6_sid_func_explicit/dynamic expect to return bool
but we have places where we return a -1 or NULL which the caller is
assuming as a True/Valid and ending up allocating Sid

Without Fix:
2025/03/10 21:44:04.295350 ZEBRA: [XWV20-TGK70] alloc_srv6_sid_func_explicit: trying to allocate explicit SID function 65088 from block fcbb:bbbb::/32
2025/03/10 21:44:04.295351 ZEBRA: [MM61M-TQZNP] alloc_srv6_sid_func_explicit: elib s 10000 e 20000 wlib s 1000 ewlib s 30000 e 1000 SID_FUNC 65088
2025/03/10 21:44:04.295352 ZEBRA: [QGHMB-SWNFW] alloc_srv6_sid_func_explicit: function 65088 is outside ELIB [10000/20000] and EWLIB alloc ranges [30000/1000]
2025/03/10 21:44:04.295367 ZEBRA: [H0GZA-NNSWJ] get_srv6_sid_explicit: allocated explicit SRv6 SID fcbb:bbbb:1:fe40:: for context End.X nh6 2001::2
2025/03/10 21:44:04.295368 ZEBRA: [XBBYD-T1Q7P] srv6_manager_get_sid_internal: got new SRv6 SID for ctx End.X nh6 2001::2: sid_value=fcbb:bbbb:1:fe40:: (func=65088) (proto=4, instance=0, sessionId=0), notifying all clients

With Fix:
2025/03/10 22:04:25.052235 ZEBRA: [MM61M-TQZNP] alloc_srv6_sid_func_explicit: elib s 30000 e 31000 wlib s 31000 ewlib s 30000 e 31000 SID_FUNC 65056
2025/03/10 22:04:25.052236 ZEBRA: [YHMRC-EMYNX] alloc_srv6_sid_func_explicit: function 65056 is outside ELIB [30000/31000] and EWLIB alloc ranges [30000/31000]
2025/03/10 22:04:25.052254 ZEBRA: [XSG8X-Q2XJX] get_srv6_sid_explicit: invalid SM request arguments: failed to allocate SID function 65056 from block fcbb:bbbb::/32
2025/03/10 22:04:25.052257 ZEBRA: [YC52T-427SJ] srv6_manager_get_sid_internal: not got SRv6 SID for ctx End.DT6 vrf_id 4, sid_value=fcbb:bbbb:1:fe20::, locator_name=MAIN
root@rajasekarr:/tmp/topotests/static_srv6_sids.test_static_srv6_sids/r1#

Ticket :#
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
7 weeks agotests: zebra_rib, test vrf change
Louis Scalbert [Mon, 23 Sep 2024 15:57:49 +0000 (17:57 +0200)]
tests: zebra_rib, test vrf change

Test table ID move to a VRF and the removal of the VRF.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 weeks agolib, tests, zebra: keep table routes at vrf disabling
Louis Scalbert [Mon, 23 Sep 2024 15:23:51 +0000 (17:23 +0200)]
lib, tests, zebra: keep table routes at vrf disabling

At VRF disabling, keep the route entries that was associated to its
table ID but not to the VRF itself. Kernel flushes these entries so we
need to reinstall them.

To do so, add a flag to mean that a route entry is owned by a table ID
and not by a VRF. If the VRF associated to the table ID is deleted, the
route entry must not be deleted.

Update to tests with new flag. 2057 is in hexa 0x809, meaning that the
new flag has been to some prefix.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 weeks agotests: zebra_rib, test vrf change
Louis Scalbert [Mon, 23 Sep 2024 15:57:49 +0000 (17:57 +0200)]
tests: zebra_rib, test vrf change

Test table ID move to a VRF and the removal of the VRF.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 weeks agozebra: fix vanished blackhole route
Louis Scalbert [Mon, 23 Sep 2024 08:59:06 +0000 (10:59 +0200)]
zebra: fix vanished blackhole route

Fix vanished blackhole route when kernel routes are updated.

> root@router# echo "100 my_table" | tee -a /etc/iproute2/rt_tables
> root@router# ip l add du0 type dummy
> root@router# ifconfig du0 192.168.0.1/24 up
> root@router# ip route add blackhole default table 100
> root@router# ip route show table 100
> blackhole default
> root@router# vtysh -c 'show ip route table 100'
> [...]
> Table 100:
> K>* 0.0.0.0/0 [0/0] unreachable (blackhole), weight 1, 00:00:05
> root@router# ip l add red type vrf table 100
> root@router# vtysh -c 'show ip route table 100'
> [...]
> Table 100:
> K>* 0.0.0.0/0 [0/0] unreachable (blackhole), weight 1, 00:00:16
> root@router# ip l set du0 master red
> root@router# vtysh -c 'show ip route table 100'
> [...]
> Table 100:
> C>* 192.168.0.0/24 is directly connected, du0, weight 1, 00:00:02
> L>* 192.168.0.1/32 is directly connected, du0, weight 1, 00:00:02
> root@router# ip route show table 100
> blackhole default
> 192.168.0.0/24 dev du0 proto kernel scope link src 192.168.0.1
> local 192.168.0.1 dev du0 proto kernel scope host src 192.168.0.1
> broadcast 192.168.0.255 dev du0 proto kernel scope link src 192.168.0.1

Fixes: d528c02a20 ("zebra: Handle kernel routes appropriately")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 weeks agozebra: fix removed default route at vrf enabling
Louis Scalbert [Thu, 22 Aug 2024 09:29:11 +0000 (11:29 +0200)]
zebra: fix removed default route at vrf enabling

When a routing table (RT) already has a default route before being
assigned to a VRF, the default route vanishes in zebra after the VRF
assignment.

> root@router:~# ip route add blackhole default table 100
> root@router:~# ip route show table 100
> blackhole default
> root@router:~# vtysh -c 'show ip route table 100'
> [...]
> VRF default table 100:
> K>* 0.0.0.0/0 [0/0] unreachable (blackhole), 00:00:05
> root@router:~# ip l add red type vrf table 100
> root@router:~# vtysh -c 'show ip route table 100'
> root@router:~#

Do not override the default route if it exists.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 weeks agozebra: remove vrf route entries at vrf disabling
Louis Scalbert [Thu, 22 Aug 2024 09:12:29 +0000 (11:12 +0200)]
zebra: remove vrf route entries at vrf disabling

This is the continuation of the previous commit.

When a VRF is deleted, the kernel retains only its own routing entries
in the former VRF table and removes all others.

This change ensures that routing entries created by FRR daemons are also
removed from the former zebra VRF table when the VRF is disabled.

To test:

> echo "100 my_table" | tee -a /etc/iproute2/rt_tables
> ip l add du0 type dummy
> ifconfig du0 192.168.0.1/24 up
> ip route add blackhole default table 100
> ip route show table 100
> ip l add red type vrf table 100
> ip l set du0 master red
> vtysh -c 'configure' -c 'vrf red' -c 'ip route 10.0.0.0/24 192.168.0.254'
> vtysh -c 'show ip route table 100'
> sleep 0.1
> ip l del red
> sleep 0.1
> vtysh -c 'show ip route table 100'
> ip l add red type vrf table 100
> ip l set du0 master red
> vtysh -c 'configure' -c 'vrf red' -c 'ip route 10.0.0.0/24 192.168.0.254'
> vtysh -c 'show ip route table 100'
> sleep 0.1
> ip l del red
> sleep 0.1
> vtysh -c 'show ip route table 100'

Fixes: d8612e6 ("zebra: Track tables allocated by vrf and cleanup")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 weeks agozebra: fix table heap-after-free crash
Louis Scalbert [Wed, 20 Nov 2024 15:33:55 +0000 (16:33 +0100)]
zebra: fix table heap-after-free crash

Fix a heap-after-free that causes zebra to crash even without
address-sanitizer. To reproduce:

> echo "100 my_table" | tee -a /etc/iproute2/rt_tables
> ip route add blackhole default table 100
> ip route show table 100
> ip l add red type vrf table 100
> ip l del red
> ip route del blackhole default table 100

Zebra manages routing tables for all existing Linux RT tables,
regardless of whether they are assigned to a VRF interface. When a table
is not assigned to any VRF, zebra arbitrarily assigns it to the default
VRF, even though this is not strictly accurate (the code expects this
behavior).

When an RT table is created after a VRF, zebra correctly assigns the
table to the VRF. However, if a VRF interface is assigned to an existing
RT table, zebra does not update the table owner, which remains as the
default VRF. As a result, existing routing entries remain under the
default VRF, while new entries are correctly assigned to the VRF. The
VRF mismatch is unexpected in the code and creates crashes and memory
related issues.

Furthermore, Linux does not automatically delete RT tables when they are
unassigned from a VRF. It is incorrect to delete these tables from zebra.

Instead, at VRF disabling, do not release the table but reassign it to
the default VRF. At VRF enabling, change the table owner back to the
appropriate VRF.

> ==2866266==ERROR: AddressSanitizer: heap-use-after-free on address 0x606000154f54 at pc 0x7fa32474b83f bp 0x7ffe94f67d90 sp 0x7ffe94f67d88
> READ of size 1 at 0x606000154f54 thread T0
>     #0 0x7fa32474b83e in rn_hash_node_const_find lib/table.c:28
>     #1 0x7fa32474bab1 in rn_hash_node_find lib/table.c:28
>     #2 0x7fa32474d783 in route_node_get lib/table.c:283
>     #3 0x7fa3247328dd in srcdest_rnode_get lib/srcdest_table.c:231
>     #4 0x55b0e4fa8da4 in rib_find_rn_from_ctx zebra/zebra_rib.c:1957
>     #5 0x55b0e4fa8e31 in rib_process_result zebra/zebra_rib.c:1988
>     #6 0x55b0e4fb9d64 in rib_process_dplane_results zebra/zebra_rib.c:4894
>     #7 0x7fa32476689c in event_call lib/event.c:1996
>     #8 0x7fa32463b7b2 in frr_run lib/libfrr.c:1232
>     #9 0x55b0e4e6c32a in main zebra/main.c:526
>     #10 0x7fa32424fd09 in __libc_start_main ../csu/libc-start.c:308
>     #11 0x55b0e4e2d649 in _start (/usr/lib/frr/zebra+0x1a1649)
>
> 0x606000154f54 is located 20 bytes inside of 56-byte region [0x606000154f40,0x606000154f78)
> freed by thread T0 here:
>     #0 0x7fa324ca9b6f in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:123
>     #1 0x7fa324668d8f in qfree lib/memory.c:130
>     #2 0x7fa32474c421 in route_table_free lib/table.c:126
>     #3 0x7fa32474bf96 in route_table_finish lib/table.c:46
>     #4 0x55b0e4fbca3a in zebra_router_free_table zebra/zebra_router.c:191
>     #5 0x55b0e4fbccea in zebra_router_release_table zebra/zebra_router.c:214
>     #6 0x55b0e4fd428e in zebra_vrf_disable zebra/zebra_vrf.c:219
>     #7 0x7fa32476fabf in vrf_disable lib/vrf.c:326
>     #8 0x7fa32476f5d4 in vrf_delete lib/vrf.c:231
>     #9 0x55b0e4e4ad36 in interface_vrf_change zebra/interface.c:1478
>     #10 0x55b0e4e4d5d2 in zebra_if_dplane_ifp_handling zebra/interface.c:1949
>     #11 0x55b0e4e4fb89 in zebra_if_dplane_result zebra/interface.c:2268
>     #12 0x55b0e4fb9f26 in rib_process_dplane_results zebra/zebra_rib.c:4954
>     #13 0x7fa32476689c in event_call lib/event.c:1996
>     #14 0x7fa32463b7b2 in frr_run lib/libfrr.c:1232
>     #15 0x55b0e4e6c32a in main zebra/main.c:526
>     #16 0x7fa32424fd09 in __libc_start_main ../csu/libc-start.c:308
>
> previously allocated by thread T0 here:
>     #0 0x7fa324caa037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
>     #1 0x7fa324668c4d in qcalloc lib/memory.c:105
>     #2 0x7fa32474bf33 in route_table_init_with_delegate lib/table.c:38
>     #3 0x7fa32474e73c in route_table_init lib/table.c:512
>     #4 0x55b0e4fbc353 in zebra_router_get_table zebra/zebra_router.c:137
>     #5 0x55b0e4fd4da0 in zebra_vrf_table_create zebra/zebra_vrf.c:358
>     #6 0x55b0e4fd3d30 in zebra_vrf_enable zebra/zebra_vrf.c:140
>     #7 0x7fa32476f9b2 in vrf_enable lib/vrf.c:286
>     #8 0x55b0e4e4af76 in interface_vrf_change zebra/interface.c:1533
>     #9 0x55b0e4e4d612 in zebra_if_dplane_ifp_handling zebra/interface.c:1968
>     #10 0x55b0e4e4fb89 in zebra_if_dplane_result zebra/interface.c:2268
>     #11 0x55b0e4fb9f26 in rib_process_dplane_results zebra/zebra_rib.c:4954
>     #12 0x7fa32476689c in event_call lib/event.c:1996
>     #13 0x7fa32463b7b2 in frr_run lib/libfrr.c:1232
>     #14 0x55b0e4e6c32a in main zebra/main.c:526
>     #15 0x7fa32424fd09 in __libc_start_main ../csu/libc-start.c:308

Fixes: d8612e6 ("zebra: Track tables allocated by vrf and cleanup")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 weeks agoMerge pull request #18348 from donaldsharp/topotest_startup_order
Jafar Al-Gharaibeh [Sun, 9 Mar 2025 03:52:16 +0000 (21:52 -0600)]
Merge pull request #18348 from donaldsharp/topotest_startup_order

Topotest startup order

7 weeks agotests: Have zebra startup look for the zserv.api socket
Donald Sharp [Fri, 7 Mar 2025 23:39:33 +0000 (18:39 -0500)]
tests: Have zebra startup look for the zserv.api socket

Ensure that the zserv.api socket is actually up and running
before moving onto other daemons after zebra.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 weeks agotests: Allow mgmtd and zebra to fully come up before other daemons
Donald Sharp [Fri, 7 Mar 2025 23:35:53 +0000 (18:35 -0500)]
tests: Allow mgmtd and zebra to fully come up before other daemons

Currently the topotest infrastructure is starting up daemons
in mgmtd,zebra, staticd then everything else.

The problem that is happening, under heavy load, is that
zebra may not be fully started and when a daemon attempts
to connect to it, it will not be able to connect.
Some of the daemons do not have great retry mechanisms at all.
In addition our normal systemctl startup scripts actually
wait a small amount of time for zebra to be ready before
moving onto the other daemons.

Let's make topotests startup a tiny bit more nuanced
and have mgmtd fully up before starting up zebra.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 weeks agoMerge pull request #18335 from karthikeyav/bitfield_copy
Mark Stapp [Fri, 7 Mar 2025 22:10:54 +0000 (17:10 -0500)]
Merge pull request #18335 from karthikeyav/bitfield_copy

lib: use memcpy in bf_copy

7 weeks agoMerge pull request #18344 from donaldsharp/fix_pytest_syntx_stuff
Jafar Al-Gharaibeh [Fri, 7 Mar 2025 20:52:29 +0000 (14:52 -0600)]
Merge pull request #18344 from donaldsharp/fix_pytest_syntx_stuff

tests: bgp_evpn_route_map_match fix invalid escape sequence

7 weeks agolib: use memcpy in bf_copy
Karthikeya Venkat Muppalla [Thu, 6 Mar 2025 21:32:26 +0000 (13:32 -0800)]
lib: use memcpy in bf_copy

use memcpy in bf_copy() instead of copy word by word in for loop

Signed-off-by: Karthikeya Venkat Muppalla <kmuppalla@nvidia.com>
7 weeks agozebra: Don't use MTYPE_TMP for l2 vni data
Donald Sharp [Fri, 7 Mar 2025 16:50:41 +0000 (11:50 -0500)]
zebra: Don't use MTYPE_TMP for l2 vni data

Convert over from MTYPE_TMP to MTYPE_L2_VNI as the
data type.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 weeks agozebra: Declutter zebra_vxlan_if_add_update_vni
Donald Sharp [Fri, 7 Mar 2025 16:37:06 +0000 (11:37 -0500)]
zebra: Declutter zebra_vxlan_if_add_update_vni

This function has equivalent code on both sides
of a if statement.  Let's consolidate this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 weeks agozebra: malloc functions cannot fail
Donald Sharp [Fri, 7 Mar 2025 16:22:03 +0000 (11:22 -0500)]
zebra: malloc functions cannot fail

Let's try to remember that when using a malloc function
it can never fail and as such testing for NULL does
nothing.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 weeks agoMerge pull request #18338 from donaldsharp/documentation_typesafe
Mark Stapp [Fri, 7 Mar 2025 16:44:00 +0000 (11:44 -0500)]
Merge pull request #18338 from donaldsharp/documentation_typesafe

Documentation typesafe

7 weeks agotests: bgp_evpn_route_map_match fix invalid escape sequence
Donald Sharp [Fri, 7 Mar 2025 15:37:51 +0000 (10:37 -0500)]
tests: bgp_evpn_route_map_match fix invalid escape sequence

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 weeks agoMerge pull request #18337 from donaldsharp/revert_keepalive_connection
Donatas Abraitis [Fri, 7 Mar 2025 07:03:15 +0000 (09:03 +0200)]
Merge pull request #18337 from donaldsharp/revert_keepalive_connection

Revert "bgpd: Make keepalive pthread be connection based."

7 weeks agoMerge pull request #18327 from donaldsharp/fixups_for_connection
Jafar Al-Gharaibeh [Fri, 7 Mar 2025 03:37:43 +0000 (21:37 -0600)]
Merge pull request #18327 from donaldsharp/fixups_for_connection

bgpd: Fix dead code in bgp_route.c #1637664

7 weeks agodoc: The sbfd documentation was not being included
Donald Sharp [Fri, 7 Mar 2025 02:54:42 +0000 (21:54 -0500)]
doc: The sbfd documentation was not being included

Add the sbfd documentation, such as it is, to the
developer documentation so that it can be read
by people.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 weeks agodoc: Developer documentation missing some build instructions
Donald Sharp [Fri, 7 Mar 2025 02:49:12 +0000 (21:49 -0500)]
doc: Developer documentation missing some build instructions

The building-frr-for-ubuntu2404 and building-doc were missing
from the compilation of developer documents.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 weeks agodoc: Add typesafe conversion examples
Donald Sharp [Fri, 7 Mar 2025 02:43:10 +0000 (21:43 -0500)]
doc: Add typesafe conversion examples

Try to give some good examples of various lists being
converted over to the typesafe way of doing things.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 weeks agolib: remove unused macro
anlan_cs [Fri, 7 Mar 2025 02:05:03 +0000 (10:05 +0800)]
lib: remove unused macro

This macro is unused and it leads to the compile error:

```
./ospfd/ospf_dump.h:78:60: error: pasting "OSPF_DEBUG_" and ""Global Graceful Restart - GR Mode\n"" does not give a valid preprocessing token
   78 | #define TERM_DEBUG_ON(a, b)      term_debug_ospf_ ## a |= (OSPF_DEBUG_ ## b)
```

Signed-off-by: anlan_cs <anlan_cs@126.com>
7 weeks agoRevert "bgpd: Make keepalive pthread be connection based."
Donald Sharp [Fri, 7 Mar 2025 01:49:44 +0000 (20:49 -0500)]
Revert "bgpd: Make keepalive pthread be connection based."

This reverts commit 23bdaba147517abb4a70d03166ad74f759888d46.

7 weeks agoMerge pull request #18315 from gromit1811/bugfix/pim6_mld_vrf_fix
Jafar Al-Gharaibeh [Thu, 6 Mar 2025 18:42:03 +0000 (12:42 -0600)]
Merge pull request #18315 from gromit1811/bugfix/pim6_mld_vrf_fix

pimd: Fix PIM6 MLD VRF support (use recvmsg() pktinfo)

7 weeks agoMerge pull request #18214 from soumyar-roy/soumya/ra514nei
Donatas Abraitis [Thu, 6 Mar 2025 18:15:19 +0000 (20:15 +0200)]
Merge pull request #18214 from soumyar-roy/soumya/ra514nei

zebra: Bring up 514 BGP neighbor sessions

7 weeks agobgpd: Fix dead code in bgp_route.c #1637664
Donald Sharp [Thu, 6 Mar 2025 14:59:19 +0000 (09:59 -0500)]
bgpd: Fix dead code in bgp_route.c #1637664

Coverity rightly points out that the worse pointer
cannot be null in this section of code.  Fix it.

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
7 weeks agoMerge pull request #18313 from donaldsharp/log_always_documented
Mark Stapp [Thu, 6 Mar 2025 14:17:52 +0000 (09:17 -0500)]
Merge pull request #18313 from donaldsharp/log_always_documented

lib: Document --command-log-always in help

7 weeks agoMerge pull request #18319 from qlyoung/fix-overriding-automake-builtin-doc-targets
Mark Stapp [Thu, 6 Mar 2025 12:55:34 +0000 (07:55 -0500)]
Merge pull request #18319 from qlyoung/fix-overriding-automake-builtin-doc-targets

doc: don't override automake builtin targets

7 weeks agodoc: don't override automake builtin targets
Quentin Young [Wed, 5 Mar 2025 20:15:35 +0000 (12:15 -0800)]
doc: don't override automake builtin targets

Automake generates default targets for `info`, `html`, `pdf` and
corresponding `install-info` and `install-html` targets to install the
artifacts generated by those rules. Prior to this change we are
overriding those targets which generates a warning.

The automake targets are designed to automatically build texinfo sources
without requiring user-specified rules. We do not have texinfo sources
so this functionality is not in use, but we are still overriding the
built in targets which is considered poor form. Automake has facilities
to modify the built in targets in the form of `-local` rules; this patch
renames the rules we had defined to use the `-local` ones.

The resulting targets generated by Automake look like this:

  html: html-am
  html-am: html-local

i.e. the final `html` target generated when using `html-local` to define
our custom rules is identical to the one we get by overriding the built
in `html` target. The same goes for the others.

So, the only effect this patch has is suppressing the warnings and
bringing us in line with Automake best practice.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
7 weeks agoMerge pull request #18195 from donaldsharp/more_connection_cleanup
Russ White [Wed, 5 Mar 2025 17:09:07 +0000 (12:09 -0500)]
Merge pull request #18195 from donaldsharp/more_connection_cleanup

More connection cleanup

7 weeks agoMerge pull request #18310 from opensourcerouting/freebsd-snmp
Donald Sharp [Wed, 5 Mar 2025 16:19:27 +0000 (11:19 -0500)]
Merge pull request #18310 from opensourcerouting/freebsd-snmp

configure.ac: fix sed failure on FreeBSD

7 weeks agopimd: Fix PIM6 MLD VRF support (use recvmsg() pktinfo)
Martin Buck [Tue, 4 Mar 2025 13:24:33 +0000 (14:24 +0100)]
pimd: Fix PIM6 MLD VRF support (use recvmsg() pktinfo)

When receiving MLD messages, prefer pktinfo over msghdr.msg_name for
determining the source interface. The latter is just the VRF master
interface in case of VRF and we need the true interface the packet was
received on instead.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
7 weeks agolib: Document --command-log-always in help
Donald Sharp [Wed, 5 Mar 2025 15:10:48 +0000 (10:10 -0500)]
lib: Document --command-log-always in help

The --command-log-always was not being listed as a valid
option for when the operator issues a <daemon> --help
command line.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 weeks agoMerge pull request #18268 from donaldsharp/yang_correct_vrf_issue
Christian Hopps [Wed, 5 Mar 2025 06:19:05 +0000 (01:19 -0500)]
Merge pull request #18268 from donaldsharp/yang_correct_vrf_issue

lib: Correct handling of /frr-vrf:lib/vrf/state/active

7 weeks agotests: add support for 514 unnumbered/v4/v6 BGP sessions
Soumya Roy [Sat, 1 Mar 2025 01:21:11 +0000 (17:21 -0800)]
tests: add support for 514 unnumbered/v4/v6 BGP sessions

Signed-off-by: Soumya Roy <souroy@nvidia.com>
7 weeks agotests: add support for bringimg up 514 BGP neighbors
Soumya Roy [Mon, 24 Feb 2025 18:53:45 +0000 (10:53 -0800)]
tests: add support for bringimg up 514 BGP neighbors

Signed-off-by: Soumya Roy <souroy@nvidia.com>
7 weeks agozebra: Bring up 514 BGP neighbor sessions
Soumya Roy [Sat, 15 Feb 2025 02:13:37 +0000 (18:13 -0800)]
zebra: Bring up 514 BGP neighbor sessions

Issue:
When 514 inerfaces/neighbors are configured, it creates socket error,
"Cannot allocate memory", when back to back V6 RA messages are tried
to be sent over the socket. This prevents interface, to know its peer's
link local address. Socket error comes when 1) try to join ICMPv6 all
router multicast group, back to back for all interfaces 2)send back to
back RA for all interfaces

Fix:
1)For ICMPv6 join case, we check if the interface has already joined
all router group, if not try to join. On failure, retry joining after
random amount of time determined 1 ms to ICMPV6_JOIN_TIMER_EXP_MS(100 ms)
2) For RA issue case, batch sending of RA mesages using wheel timer

Testing:
Monitor BGP session running sh bgp summary command

Before fix:
r1# sh bgp summary

IPv4 Unicast Summary:
BGP router identifier 192.168.1.1, local AS number 1001 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 515, using 12 MiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
r1-eth0         4       1002        89        90        0    0    0 00:07:10            0        0 N/A
r1-eth1         4       1002        89        90        0    0    0 00:07:10            0        0 N/A
r1-eth2         4       1002        89        90        0    0    0 00:07:10            0        0 N/A
r1-eth3         4       1002        89        90        0    0    0 00:07:10            0        0 N/A
r1-eth4         4       1002        89        90        0    0    0 00:07:10            0        0 N/A
r1-eth5         4       1002        89        90        0    0    0 00:07:10            0        0 N/A

…..<snip>...
r1-eth252       4       1002        31        29        0    0    0 00:02:08            0        0 N/A
r1-eth253       4       1002        31        29        0    0    0 00:02:08            0        0 N/A
r1-eth254       4       1002        31        29        0    0    0 00:02:08            0        0 N/A
r1-eth255       4       1002        31        29        0    0    0 00:02:08            0        0 N/A
r1-eth256       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth257       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth258       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth259       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth260       4          0         0         0        0    0    0    never         Idle        0 N/A
……..<snip>…..
r1-eth511       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth512       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth513       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth514       4          0         0         0        0    0    0    never         Idle        0 N/A
After fix:
r1# show bgp summary

IPv4 Unicast Summary:
BGP router identifier 192.168.1.1, local AS number 1001 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 515, using 12 MiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
r1-eth0         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth1         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth2         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth3         4       1002        64        67        0    0    0 00:05:09            0        0 N/A
r1-eth4         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth5         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth6         4       1002        67        70        0    0    0 00:05:22            0        0 N/A
r1-eth7         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth8         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
....
r1-eth499       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth500       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth501       4       1002        19        22        0    0    0 00:01:21            0        0 N/A
r1-eth502       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth503       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth504       4       1002        20        23        0    0    0 00:01:30            0        0 N/A
r1-eth505       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth506       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth507       4       1002        22        25        0    0    0 00:01:39            0        0 N/A
r1-eth508       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth509       4       1002        17        20        0    0    0 00:01:13            0        0 N/A
r1-eth510       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth511       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth512       4       1002        19        22        0    0    0 00:01:22            0        0 N/A
r1-eth513       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth514       4       1002        43        43        0    0    0 00:03:22            0        0 N/A

Signed-off-by: Soumya Roy <souroy@nvidia.com>
7 weeks agoMerge pull request #18293 from y-bharath14/srib-yang-v4
Christian Hopps [Wed, 5 Mar 2025 05:58:44 +0000 (00:58 -0500)]
Merge pull request #18293 from y-bharath14/srib-yang-v4

yang: Imported modules are not in use

8 weeks agoconfigure.ac: fix sed failure on FreeBSD
Rafael Zalamena [Tue, 4 Mar 2025 19:54:18 +0000 (16:54 -0300)]
configure.ac: fix sed failure on FreeBSD

Simplify the sed expression to make sure it works on all platforms.

The previous expression failed on FreeBSD and it caused the SNMP_LIBS
variable to be empty. When SNMP_LIBS is empty it will cause binaries
and/or libraries to not link against the correct libraries.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
8 weeks agoyang: Imported modules are not in use
Y Bharath [Mon, 3 Mar 2025 07:25:30 +0000 (12:55 +0530)]
yang: Imported modules are not in use

Imported modules are not in use

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
8 weeks agoMerge pull request #18306 from LabNConsulting/aceelindem/bfd-log-session-changes
Russ White [Tue, 4 Mar 2025 14:48:36 +0000 (09:48 -0500)]
Merge pull request #18306 from LabNConsulting/aceelindem/bfd-log-session-changes

bfdd: Add "log-session-changes" command to BFD configuration and operational state via YANG Northbound API.

8 weeks agoMerge pull request #18301 from pguibert6WIND/vpn_prefix_aggregate_export_and_accept
Russ White [Tue, 4 Mar 2025 14:39:52 +0000 (09:39 -0500)]
Merge pull request #18301 from pguibert6WIND/vpn_prefix_aggregate_export_and_accept

Vpn prefix aggregate export and accept

8 weeks agoMerge pull request #18253 from dksharp5/yang_zebra
Russ White [Tue, 4 Mar 2025 14:25:24 +0000 (09:25 -0500)]
Merge pull request #18253 from dksharp5/yang_zebra

Allow retrieval of v4/v6 forwarding state via NB

8 weeks agoMerge pull request #17961 from opensourcerouting/fix/bgp_reject_as_aggregate
Russ White [Tue, 4 Mar 2025 14:18:38 +0000 (09:18 -0500)]
Merge pull request #17961 from opensourcerouting/fix/bgp_reject_as_aggregate

bgpd: Do not advertise aggregate routes to contributing ASes

8 weeks agobfdd: Add BFD "log-session-changes" feature.
Acee Lindem [Mon, 3 Mar 2025 22:46:01 +0000 (22:46 +0000)]
bfdd: Add BFD "log-session-changes" feature.

Add the BFD "log-session-changes" via the YANG and northbound API. Also
add the configured value to show and operational state.

Signed-off-by: Acee Lindem <acee@lindem.com>
8 weeks agoyang: Add "log-session-changes" to BFD common session parameters.
Acee Lindem [Mon, 3 Mar 2025 20:57:48 +0000 (20:57 +0000)]
yang: Add "log-session-changes" to BFD common session parameters.

Signed-off-by: Acee Lindem <acee@lindem.com>
8 weeks agodoc: Add "log-session-changes" documentation.
Acee Lindem [Mon, 3 Mar 2025 20:22:50 +0000 (20:22 +0000)]
doc: Add "log-session-changes" documentation.

Signed-off-by: Acee Lindem <acee@lindem.com>
8 weeks agotests: Add "log-session-changes" to bfd_topo1 r1 and r2 configs.
Acee Lindem [Mon, 3 Mar 2025 20:21:55 +0000 (20:21 +0000)]
tests: Add "log-session-changes" to bfd_topo1 r1 and r2 configs.

Signed-off-by: Acee Lindem <acee@lindem.com>
8 weeks agotopotests: add a test to configure aggregated summary-only prefix on VPN
Philippe Guibert [Mon, 3 Mar 2025 16:25:04 +0000 (17:25 +0100)]
topotests: add a test to configure aggregated summary-only prefix on VPN

That configured aggregated prefix should be present, but all other
suppressed prefixes should not be exported.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 weeks agobgpd: fix syncs suppressed prefixes in VPN environments
Philippe Guibert [Mon, 3 Mar 2025 16:11:33 +0000 (17:11 +0100)]
bgpd: fix syncs suppressed prefixes in VPN environments

By using the summary-only option for aggregated prefixes, the suppressed
prefixes are however exported as VPN prefixes, whereas they should not.

> r1# show bgp vrf vrf1 ipv4
> [..]
>  *>  172.31.1.0/24    0.0.0.0                  0         32768 ?
>  s>  172.31.1.1/32    0.0.0.0                  0         32768 ?
>  s>  172.31.1.2/32    0.0.0.0                  0         32768 ?
>  s>  172.31.1.3/32    0.0.0.0                  0         32768 ?
> [..]
> r1#
>
> r1# show bgp ipv4 vpn
> [..]
>  *>  172.31.1.0/24    0.0.0.0@4<               0         32768 ?
>     UN=0.0.0.0 EC{52:100} label=101 type=bgp, subtype=5
>  *>  172.31.1.1/32    0.0.0.0@4<               0         32768 ?
>     UN=0.0.0.0 EC{52:100} label=101 type=bgp, subtype=5
>  *>  172.31.1.2/32    0.0.0.0@4<               0         32768 ?
>     UN=0.0.0.0 EC{52:100} label=101 type=bgp, subtype=5
>  *>  172.31.1.3/32    0.0.0.0@4<               0         32768 ?
>     UN=0.0.0.0 EC{52:100} label=101 type=bgp, subtype=5
> [..]
> r1#

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 weeks agotopotests: add a test to unconfigure aggregated prefix on VPN
Philippe Guibert [Mon, 3 Mar 2025 16:22:59 +0000 (17:22 +0100)]
topotests: add a test to unconfigure aggregated prefix on VPN

That test will ensure the VPN prefix associated is removed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 weeks agobgpd: fix remove vpn aggregated prefix upon unconfiguration
Philippe Guibert [Mon, 3 Mar 2025 16:21:19 +0000 (17:21 +0100)]
bgpd: fix remove vpn aggregated prefix upon unconfiguration

When unconfiguring an aggregated prefix, the VPN prefix is not
removed. Fix this by refreshing the VPN leak when the aggregated route
is or is not available.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 weeks agotopotests: add vpn test to control aggregated prefix is exported
Philippe Guibert [Mon, 3 Mar 2025 14:31:09 +0000 (15:31 +0100)]
topotests: add vpn test to control aggregated prefix is exported

Add a test in bgp_vpnv4_ebgp test to control that the aggregated prefix
is exported and selected as a VPN prefix.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 weeks agobgpd: fix export, and selects l3vpn aggregated prefix
Philippe Guibert [Mon, 3 Mar 2025 13:40:42 +0000 (14:40 +0100)]
bgpd: fix export, and selects l3vpn aggregated prefix

On a L3VPN setup, an aggretated prefix can not be exported and selected.
The below example illustrates the 172.31.0.0/24 aggregated prefix, which
is valid as a VRF prefix, but invalid as a VPN prefix:

> r1# show bgp ipv4 vpn 172.31.0.0/24
> BGP routing table entry for 444:1:172.31.0.0/24, version 0
> not allocated
> Paths: (1 available, no best path)
>   Not advertised to any peer
>   Local, (aggregated by 65500 192.0.2.1)
>     0.0.0.0 from 0.0.0.0 (192.0.2.1) vrf vrf1(4) announce-nh-self
>       Origin incomplete, metric 0, weight 32768, invalid, sourced,
local, atomic-aggregate
>       Extended Community: RT:52:100
>       Originator: 192.0.2.1
>       Remote label: 101
>       Last update: Mon Mar  3 14:35:04 2025
> r1# show bgp vrf vrf1 ipv4 172.31.0.0/24
> BGP routing table entry for 172.31.0.0/24, version 1
> Paths: (1 available, best #1, vrf vrf1)
>   Not advertised to any peer
>   Local, (aggregated by 65500 192.0.2.1)
>     0.0.0.0 from 0.0.0.0 (192.0.2.1)
>       Origin incomplete, metric 0, weight 32768, valid, aggregated,
local, atomic-aggregate, best (First path received)
>       Last update: Mon Mar  3 14:35:03 2025
> r1#

Actually, the aggregated prefix nexthop is considered, and 0.0.0.0 is
an invalid nexthop.

> r1# show bgp vrf vrf1 nexthop
> Current BGP nexthop cache:
>  0.0.0.0 invalid, #paths 1
>   Is not Registered
>   Last update: Thu Feb 13 18:33:43 2025

Fix this by considering the L3VPN prefix selected, if the VRF prefix
is selected too.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 weeks agoMerge pull request #18030 from fdumontet6WIND/mem_alloc_stream
Mark Stapp [Mon, 3 Mar 2025 16:09:47 +0000 (11:09 -0500)]
Merge pull request #18030 from fdumontet6WIND/mem_alloc_stream

zebra: reduce memory usage by streams when redistributing routes

8 weeks agoMerge pull request #18294 from Orange-OpenSource/isisd
Donald Sharp [Mon, 3 Mar 2025 12:37:42 +0000 (07:37 -0500)]
Merge pull request #18294 from Orange-OpenSource/isisd

isisd: Correct edge insertion into TED

8 weeks agoisisd: Correct edge insertion into TED
Olivier Dugeon [Mon, 3 Mar 2025 09:08:17 +0000 (10:08 +0100)]
isisd: Correct edge insertion into TED

Edges are not correctly linked to Vertices during LSP processing. In function
lsp_to_edge_cb(), once edge created or updated from the LSP TLVs, the code try
to link the edge to destination vertices. In case the revert edge is not found,
the code try to found a destination vertex to link to. But, the sys_id used
for this operation corresponds to the source vertex. As a result, the edge is
attached as source and destination of the vertex. When Traffic Engineering is
stopped, TED is deleted which result into a double free of the edge attributes.
This cause a crash when attempt to free extended admin groupi the second time.

This patch removed wrong code which link twice the edge to the source vertex.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
8 weeks agoMerge pull request #18289 from cscarpitta/fix/fix_no_srv6_staticd
Donatas Abraitis [Mon, 3 Mar 2025 07:24:39 +0000 (09:24 +0200)]
Merge pull request #18289 from cscarpitta/fix/fix_no_srv6_staticd

staticd: Fix `no srv6` command