]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
4 days agoMerge pull request #18714 from FRRouting/mergify/bp/stable/10.3/pr-18672 stable/10.3
Donald Sharp [Thu, 24 Apr 2025 14:00:39 +0000 (10:00 -0400)]
Merge pull request #18714 from FRRouting/mergify/bp/stable/10.3/pr-18672

pimd: Fix for crash during networking restart (backport #18672)

5 days agopimd: Fix for crash during networking restart 18714/head
Utkarsh Srivastava [Thu, 10 Apr 2025 05:49:34 +0000 (22:49 -0700)]
pimd: Fix for crash during networking restart

During vrf delete, the vxlan_info.work_list
linked list was deleted which is a global list
containing the SGs for all the VRFs.

If two vrfs are configured, vrf a and vrf b and
both has SGs assocaited with them which are
inserted in the vxlan_info.work_list. Now if
vrf a is deleted, it deletes the work_list also.
Due to this when any SG add or del comes for vrf b
it tries to access the work_list and crashes.

Fix
Delete the vxlan_info.work_list only when all the
VRFs are terminated and unset the vxlan_info.flags
so if new add cmd comes it re-allocates the work_list.

Signed-off-by: usrivastava-nvidia <usrivastava@nvidia.com>
(cherry picked from commit b88cce233043806129eb6d8c938655b2886ec898)

7 days agoMerge pull request #18681 from lawli3t/frr-10.3-backport
Donatas Abraitis [Tue, 22 Apr 2025 02:41:38 +0000 (05:41 +0300)]
Merge pull request #18681 from lawli3t/frr-10.3-backport

bgpd: Treat the peer as not active due to BFD down only if established (backport #18562)

11 days agobgpd: Treat the peer as not active due to BFD down only if established (backport... 18681/head
Stefan Hanreich [Fri, 18 Apr 2025 08:36:19 +0000 (10:36 +0200)]
bgpd: Treat the peer as not active due to BFD down only if established (backport #18562)

If we have `neighbor X bfd` and BFD status is DOWN and/or ADMIN_DOWN, and BGP
session is not yet established, we never allow the session to establish.

Let's fix this regression that was in 10.2.

Fixes: 1fb48f5 ("bgpd: Do not start BGP session if BFD profile is in shutdown state")
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
12 days agoMerge pull request #18670 from FRRouting/mergify/bp/stable/10.3/pr-18667
Jafar Al-Gharaibeh [Wed, 16 Apr 2025 14:37:19 +0000 (09:37 -0500)]
Merge pull request #18670 from FRRouting/mergify/bp/stable/10.3/pr-18667

isisd: fix srv6_sid memory leak (backport #18667)

12 days agoisisd: fix srv6_sid memory leak 18670/head
Louis Scalbert [Wed, 16 Apr 2025 09:23:54 +0000 (11:23 +0200)]
isisd: fix srv6_sid memory leak

Seen with isis_srv6_topo1 topotest.

> ==178793==ERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 56 byte(s) in 1 object(s) allocated from:
>     #0 0x7f3f63cb4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
>     #1 0x7f3f6366f8dd in qcalloc lib/memory.c:105
>     #2 0x561b810c62b7 in isis_srv6_sid_alloc isisd/isis_srv6.c:243
>     #3 0x561b8111f944 in isis_zebra_srv6_sid_notify isisd/isis_zebra.c:1534
>     #4 0x7f3f637df9d7 in zclient_read lib/zclient.c:4845
>     #5 0x7f3f637779b2 in event_call lib/event.c:2011
>     #6 0x7f3f63642ff1 in frr_run lib/libfrr.c:1216
>     #7 0x561b81018bf2 in main isisd/isis_main.c:360
>     #8 0x7f3f63029d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Fixes: 0af0f4616d ("isisd: Receive SRv6 SIDs notifications from zebra")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 25c813ac382ba79270f40b85e168cdbcad499e2d)

12 days agoMerge pull request #18666 from FRRouting/mergify/bp/stable/10.3/pr-18662
Mark Stapp [Wed, 16 Apr 2025 11:44:05 +0000 (07:44 -0400)]
Merge pull request #18666 from FRRouting/mergify/bp/stable/10.3/pr-18662

tests: Fix northbound endian use in a unit-test (backport #18662)

13 days agotests: add nb test binary to .gitignore 18666/head
Mark Stapp [Tue, 15 Apr 2025 17:16:07 +0000 (13:16 -0400)]
tests: add nb test binary to .gitignore

Add a northbound unit-test binary product to .gitignore

Signed-off-by: Mark Stapp <mjs@cisco.com>
(cherry picked from commit b256f2f1e90fd40ffb791d79dbdcaf71c3ab1a04)

13 days agotests: use little-endian order for libyang api
Mark Stapp [Tue, 15 Apr 2025 17:15:09 +0000 (13:15 -0400)]
tests: use little-endian order for libyang api

Use the expected - little-endian - byte-order for a param
to one of the libyang apis; tests fail on LE architectures
otherwise.

Signed-off-by: Mark Stapp <mjs@cisco.com>
(cherry picked from commit da8fce3830baa2fd4d70050a3f7677d6e8bd5ad4)

2 weeks agoMerge pull request #18650 from FRRouting/mergify/bp/stable/10.3/pr-18649
Donald Sharp [Sun, 13 Apr 2025 12:43:46 +0000 (08:43 -0400)]
Merge pull request #18650 from FRRouting/mergify/bp/stable/10.3/pr-18649

Rpki testing and bug fix (backport #18649)

2 weeks agotests: Add more tests to bgp_rpki_topo1 test 18650/head
Donald Sharp [Sat, 12 Apr 2025 20:32:34 +0000 (16:32 -0400)]
tests: Add more tests to bgp_rpki_topo1 test

Looking at the gcov of the rpki code, I noticed
that there was some functionality that is not
covered in our test suites.  Add the functionality.

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
(cherry picked from commit dbff585b411edba20fc73b5e509ef9c1bc0697b2)

2 weeks agobgpd: Prevent crash when issuing a show rpki connections
Donald Sharp [Sat, 12 Apr 2025 20:56:30 +0000 (16:56 -0400)]
bgpd: Prevent crash when issuing a show rpki connections

When attempting to check rpki status and the connection
has been turned off, let's check to see if we are connected
before we ask the rpki subsystem, else we will get a crash
in the rpki library.

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
(cherry picked from commit dcf43ae009ffecf206fb8cf8896eb5cd616ba4e5)

2 weeks agoMerge pull request #18646 from FRRouting/mergify/bp/stable/10.3/pr-18628
Carmine Scarpitta [Sat, 12 Apr 2025 10:47:46 +0000 (10:47 +0000)]
Merge pull request #18646 from FRRouting/mergify/bp/stable/10.3/pr-18628

tools: fix reload script for SRv6 locators and formats (backport #18628)

2 weeks agotools: fix reload script for SRv6 locators and formats 18646/head
Rajasekar Raja [Tue, 8 Apr 2025 22:06:57 +0000 (15:06 -0700)]
tools: fix reload script for SRv6 locators and formats

Current code implementation does not have a "no" form of handling for
the following commands under segment-routing srv6
 - no formats
 - no locators
 - no prefix <> under locator XYZ

Fix the handling of segment-routing srv6 locators and formats commands
 - Ignore "no formats" and "no locators" command
 - replace "no prefix" under locator XYZ as "no locator XYZ" as prefix
   is a mandatory property of locator

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit ce06d35fa983c67d25d93f5c2533610490313699)

2 weeks agoMerge pull request #18636 from FRRouting/mergify/bp/stable/10.3/pr-18548
Jafar Al-Gharaibeh [Thu, 10 Apr 2025 22:20:19 +0000 (17:20 -0500)]
Merge pull request #18636 from FRRouting/mergify/bp/stable/10.3/pr-18548

babeld: fix incorrect type assignment in parse_request_subtlv (backport #18548)

2 weeks agobabeld: fix incorrect type assignment in parse_request_subtlv 18636/head
zmw12306 [Mon, 31 Mar 2025 04:08:38 +0000 (00:08 -0400)]
babeld: fix incorrect type assignment in parse_request_subtlv

parse_request_subtlv accesses type using fixed offset instead of current position.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
(cherry picked from commit 1571607c6bcba8f6861bdb90f472fe534df78a80)

2 weeks agoMerge pull request #18618 from FRRouting/mergify/bp/stable/10.3/pr-18583
Jafar Al-Gharaibeh [Wed, 9 Apr 2025 03:12:46 +0000 (22:12 -0500)]
Merge pull request #18618 from FRRouting/mergify/bp/stable/10.3/pr-18583

babeld: check valid babel port (backport #18583)

2 weeks agoMerge pull request #18612 from FRRouting/mergify/bp/stable/10.3/pr-18526
Jafar Al-Gharaibeh [Wed, 9 Apr 2025 03:12:18 +0000 (22:12 -0500)]
Merge pull request #18612 from FRRouting/mergify/bp/stable/10.3/pr-18526

pimd: Fix memory leak on shutdown (backport #18526)

2 weeks agoMerge pull request #18616 from FRRouting/mergify/bp/stable/10.3/pr-18598
Jafar Al-Gharaibeh [Wed, 9 Apr 2025 03:12:02 +0000 (22:12 -0500)]
Merge pull request #18616 from FRRouting/mergify/bp/stable/10.3/pr-18598

nhrpd: Add Hop Count Validation Before Forwarding in nhrp_peer_recv() (backport #18598)

2 weeks agoMerge pull request #18619 from FRRouting/mergify/bp/stable/10.3/pr-18614
Donatas Abraitis [Wed, 9 Apr 2025 00:59:12 +0000 (03:59 +0300)]
Merge pull request #18619 from FRRouting/mergify/bp/stable/10.3/pr-18614

bgpd: On shutdown free up memory leak found by topotest (backport #18614)

2 weeks agobgpd: On shutdown free up memory leak found by topotest 18619/head
Donald Sharp [Tue, 8 Apr 2025 15:47:50 +0000 (11:47 -0400)]
bgpd: On shutdown free up memory leak found by topotest

This commit fixes two types of problems:

a) Avoidance of cleaning up memory when a instance is
hidden, thus causing it never to be freed on shutdown

b) In some instances bgp_create is called 2 times
for some code.  We are double allocating memory
and dropping it on the second allocation.

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

2 weeks agobabeld: check valid babel port 18618/head
zmw12306 [Sat, 5 Apr 2025 19:14:12 +0000 (15:14 -0400)]
babeld: check valid babel port

Add checking for port == 6696.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
(cherry picked from commit 6f88868f325f0269198fb8e0c00b40a7bbe0e53f)

2 weeks agonhrpd: Add Hop Count Validation Before Forwarding in nhrp_peer_recv() 18616/head
zmw12306 [Mon, 7 Apr 2025 20:13:45 +0000 (16:13 -0400)]
nhrpd: Add Hop Count Validation Before Forwarding in nhrp_peer_recv()

According to [RFC 2332, Section 5.1], if an NHS receives a packet that it would normally forward and the hop count is zero, it must send an error indication back to the source and drop the packet.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
(cherry picked from commit 7c877164820bfc1cd7f84b3f7529f716b0f897cd)

2 weeks agoMerge pull request #18609 from cscarpitta/fix/backport_check_sid_loc_block_beforehand
Jafar Al-Gharaibeh [Tue, 8 Apr 2025 15:56:13 +0000 (10:56 -0500)]
Merge pull request #18609 from cscarpitta/fix/backport_check_sid_loc_block_beforehand

staticd: Avoid requesting SRv6 sid from zebra when loc and sid block don't match (manual backport #18580)

2 weeks agopimd: Fix memory leak on shutdown 18612/head
Donald Sharp [Thu, 27 Mar 2025 14:20:07 +0000 (10:20 -0400)]
pimd: Fix memory leak on shutdown

The gm_join_list has a setup where it attempts to only
create the list upon need and deletes it when the list
is empty.  On interface shutdown it was calling the
function to empty the list but it was not empty so
the list was being left at the end.  Just add a bit
of code to really clean up the list in the shutdown
case.

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    0 0x7f84850b83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    1 0x7f8484c391c4 in qcalloc lib/memory.c:106
    2 0x7f8484c1ad36 in list_new lib/linklist.c:49
    3 0x55d982827252 in pim_if_gm_join_add pimd/pim_iface.c:1354
    4 0x55d982852b59 in lib_interface_gmp_address_family_join_group_create pimd/pim_nb_config.c:4499
    5 0x7f8484c6a5d3 in nb_callback_create lib/northbound.c:1512
    6 0x7f8484c6a5d3 in nb_callback_configuration lib/northbound.c:1910
    7 0x7f8484c6bb51 in nb_transaction_process lib/northbound.c:2042
    8 0x7f8484c6c164 in nb_candidate_commit_apply lib/northbound.c:1381
    9 0x7f8484c6c39f in nb_candidate_commit lib/northbound.c:1414
    10 0x7f8484c6cf1c in nb_cli_classic_commit lib/northbound_cli.c:57
    11 0x7f8484c72f67 in nb_cli_apply_changes_internal lib/northbound_cli.c:195
    12 0x7f8484c73a2e in nb_cli_apply_changes lib/northbound_cli.c:251
    13 0x55d9828bd30f in interface_ip_igmp_join_magic pimd/pim_cmd.c:5436
    14 0x55d9828bd30f in interface_ip_igmp_join pimd/pim_cmd_clippy.c:6366
    15 0x7f8484bb5cbd in cmd_execute_command_real lib/command.c:1003
    16 0x7f8484bb5fdc in cmd_execute_command lib/command.c:1062
    17 0x7f8484bb6508 in cmd_execute lib/command.c:1228
    18 0x7f8484cfb6ec in vty_command lib/vty.c:626
    19 0x7f8484cfbc3f in vty_execute lib/vty.c:1389
    20 0x7f8484cff9f0 in vtysh_read lib/vty.c:2408
    21 0x7f8484cec846 in event_call lib/event.c:1984
    22 0x7f8484c1a10a in frr_run lib/libfrr.c:1246
    23 0x55d9828fc765 in main pimd/pim_main.c:166
    24 0x7f848470c249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:

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

2 weeks agostaticd: Avoid requesting SRv6 sid from zebra when loc and sid block dont match 18609/head
Carmine Scarpitta [Tue, 8 Apr 2025 13:17:42 +0000 (15:17 +0200)]
staticd: Avoid requesting SRv6 sid from zebra when loc and sid block dont match

Currently, when the locator block and sid block differs, staticd would
still go ahead and request zebra to allocate the SID which it does if
there is atleast one match (from any locators).

Only when staticd tries to install the route, it sees that the locator
block and sid block are different and avoids installing the route.

Fix:
Check if the locator block and sid block match before even requesting
Zebra to allocate one.

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit dbd9fed0b30dd1d3475686f71f87d326eeafd26c)

3 weeks agoMerge pull request #18576 from FRRouting/mergify/bp/stable/10.3/pr-18567
Donatas Abraitis [Fri, 4 Apr 2025 06:02:03 +0000 (09:02 +0300)]
Merge pull request #18576 from FRRouting/mergify/bp/stable/10.3/pr-18567

pimd: Initialize gm proxy to false (backport #18567)

3 weeks agopimd: Initialize gm proxy to false 18576/head
Nathan Bahr [Wed, 2 Apr 2025 21:07:41 +0000 (21:07 +0000)]
pimd: Initialize gm proxy to false

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
(cherry picked from commit 153d9ea3b99d07015191924866ae14bb0525365a)

3 weeks agoMerge pull request #18573 from FRRouting/mergify/bp/stable/10.3/pr-18572
Jafar Al-Gharaibeh [Thu, 3 Apr 2025 21:41:54 +0000 (16:41 -0500)]
Merge pull request #18573 from FRRouting/mergify/bp/stable/10.3/pr-18572

tests: Fix typo when configuring delayopen timer (backport #18572)

3 weeks agotests: Fix typo when configuring delayopen timer 18573/head
Donatas Abraitis [Thu, 3 Apr 2025 11:01:20 +0000 (14:01 +0300)]
tests: Fix typo when configuring delayopen timer

`"` was accidentally added, and random tests failures happening.

Fixes: a4f61b78dd382c438ff4fec2fda7450ecc890edf ("tests: Check if routes are marked as stale and retained with N-bit for GR")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 55d88ee3de422ff6dc206c6ebe5ba96b3ff67967)

3 weeks agoMerge pull request #18569 from FRRouting/mergify/bp/stable/10.3/pr-18494
Donatas Abraitis [Thu, 3 Apr 2025 10:39:07 +0000 (13:39 +0300)]
Merge pull request #18569 from FRRouting/mergify/bp/stable/10.3/pr-18494

lib: Return duplicate prefix-list entry test (backport #18494)

3 weeks agoMerge pull request #18565 from FRRouting/mergify/bp/stable/10.3/pr-18561
Donatas Abraitis [Thu, 3 Apr 2025 06:46:46 +0000 (09:46 +0300)]
Merge pull request #18565 from FRRouting/mergify/bp/stable/10.3/pr-18561

lib: Return duplicate ipv6 prefix-list entry test (backport #18561)

3 weeks agolib: Return duplicate prefix-list entry test 18569/head
Donatas Abraitis [Tue, 25 Mar 2025 11:54:24 +0000 (13:54 +0200)]
lib: Return duplicate prefix-list entry test

If we do e.g.:

ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32
ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32
ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32

We end up, having duplicate records with a different sequence number only.

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

3 weeks agolib: Return duplicate ipv6 prefix-list entry test 18565/head
Donatas Abraitis [Wed, 2 Apr 2025 08:09:59 +0000 (11:09 +0300)]
lib: Return duplicate ipv6 prefix-list entry test

Fixes: 8384d41144496019725c1e250abd0ceea854341f ("lib: Return duplicate prefix-list entry test")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 24ae7cd30a055dc17fc9d75762320e1359e005b2)

3 weeks agoMerge pull request #18527 from FRRouting/mergify/bp/stable/10.3/pr-18502
Russ White [Tue, 1 Apr 2025 14:25:27 +0000 (10:25 -0400)]
Merge pull request #18527 from FRRouting/mergify/bp/stable/10.3/pr-18502

bgpd: Set the label for MP_UNREACH_NLRI 0x800000 instead of 0x000000 (backport #18502)

3 weeks agoMerge pull request #18511 from FRRouting/mergify/bp/stable/10.3/pr-18498
Russ White [Tue, 1 Apr 2025 14:20:36 +0000 (10:20 -0400)]
Merge pull request #18511 from FRRouting/mergify/bp/stable/10.3/pr-18498

bgpd: Retain the routes if we do a clear with N-bit set for Graceful-Restart (backport #18498)

4 weeks agoMerge pull request #18509 from FRRouting/mergify/bp/stable/10.3/pr-18503
Donatas Abraitis [Sun, 30 Mar 2025 17:29:07 +0000 (20:29 +0300)]
Merge pull request #18509 from FRRouting/mergify/bp/stable/10.3/pr-18503

ospf6d: Fix LSA memory leaks related to graceful restart (backport #18503)

4 weeks agotests: Use label 0x800000 instead of 0x000000 for BMP tests mergify/bp/stable/10.3/pr-18502 18527/head
Donatas Abraitis [Wed, 26 Mar 2025 12:47:44 +0000 (14:47 +0200)]
tests: Use label 0x800000 instead of 0x000000 for BMP tests

Related-to: 94e2aadf7187d7d695babce21033b5bc8e454f25 ("bgpd: Set the label for MP_UNREACH_NLRI 0x800000 instead of 0x000000")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit e69459c7144568381c05bbaf962adecd914975d5)

4 weeks agobgpd: Set the label for MP_UNREACH_NLRI 0x800000 instead of 0x000000
Donatas Abraitis [Wed, 26 Mar 2025 08:30:52 +0000 (10:30 +0200)]
bgpd: Set the label for MP_UNREACH_NLRI 0x800000 instead of 0x000000

RFC8277 says:

The procedures in [RFC3107] for withdrawing the binding of a label
or sequence of labels to a prefix are not specified clearly and correctly.

=> How to Explicitly Withdraw the Binding of a Label to a Prefix

Suppose a BGP speaker has announced, on a given BGP session, the
   binding of a given label or sequence of labels to a given prefix.
   Suppose it now wishes to withdraw that binding.  To do so, it may
   send a BGP UPDATE message with an MP_UNREACH_NLRI attribute.  The
   NLRI field of this attribute is encoded as follows:

      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |    Length     |        Compatibility                          |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                          Prefix                               ~
     ~                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                       Figure 4: NLRI for Withdrawal

   Upon transmission, the Compatibility field SHOULD be set to 0x800000.
   Upon reception, the value of the Compatibility field MUST be ignored.

[RFC3107] also made it possible to withdraw a binding without
   specifying the label explicitly, by setting the Compatibility field
   to 0x800000.  However, some implementations set it to 0x000000.  In
   order to ensure backwards compatibility, it is RECOMMENDED by this
   document that the Compatibility field be set to 0x800000, but it is
   REQUIRED that it be ignored upon reception.

In FRR case where a single label is used per-prefix, we should send 0x800000,
and not 0x000000.

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

4 weeks agobgpd: Remove unused defines from bgp_label.h
Donatas Abraitis [Wed, 26 Mar 2025 06:50:06 +0000 (08:50 +0200)]
bgpd: Remove unused defines from bgp_label.h

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

4 weeks agotests: Fix wait times in test_ospf6_gr_topo1 topotest 18509/head
Martin Buck [Tue, 25 Mar 2025 15:53:12 +0000 (16:53 +0100)]
tests: Fix wait times in test_ospf6_gr_topo1 topotest

Increase wait times to at least the minimum wait time accepted by
topotest.run_and_expect(). Also change poll interval to 1s, no point in
doings this more frequently.

Finally, slightly improve the topology diagram to also include area numbers.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
(cherry picked from commit b73e3ae69dfd2050dc061b81040a4748d8992ddd)

4 weeks agoospf6d: Fix LSA memory leaks related to graceful restart
Martin Buck [Tue, 25 Mar 2025 15:32:47 +0000 (16:32 +0100)]
ospf6d: Fix LSA memory leaks related to graceful restart

Fixes leaks reported by ospf6_gr_topo1 topotest.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
(cherry picked from commit 0db0e7fbd7c6d6c5ba32c741385bc1b2d1acfa77)

4 weeks agotests: Check if routes are marked as stale and retained with N-bit for GR mergify/bp/stable/10.3/pr-18498 18511/head
Donatas Abraitis [Tue, 25 Mar 2025 15:35:41 +0000 (17:35 +0200)]
tests: Check if routes are marked as stale and retained with N-bit for GR

Related-to: b7c657d4e065f310fcf6454abae1a963c208c3b8 ("bgpd: Retain the routes if we do a clear with N-bit set for Graceful-Restart")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit a4f61b78dd382c438ff4fec2fda7450ecc890edf)

4 weeks agobgpd: Retain the routes if we do a clear with N-bit set for Graceful-Restart
Donatas Abraitis [Tue, 25 Mar 2025 15:20:56 +0000 (17:20 +0200)]
bgpd: Retain the routes if we do a clear with N-bit set for Graceful-Restart

On receiving side we already did the job correctly, but the peer which initiates
the clear does not retain the other's routes. This commit fixes that.

Fixes: 20170775da3a3c5d41aba714d0c1d5a29b0da61c ("bgpd: Activate Graceful-Restart when receiving CEASE/HOLDTIME notifications")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit b7c657d4e065f310fcf6454abae1a963c208c3b8)

4 weeks agoMerge pull request #18522 from opensourcerouting/fix/revert_18478
Mark Stapp [Thu, 27 Mar 2025 20:22:43 +0000 (16:22 -0400)]
Merge pull request #18522 from opensourcerouting/fix/revert_18478

Revert backport for crash when modifying SRv6 SID for stable/10.3 branch

4 weeks agoRevert "staticd: Fix crash that occurs when modifying an SRv6 SID" 18522/head
Donatas Abraitis [Thu, 27 Mar 2025 11:35:39 +0000 (13:35 +0200)]
Revert "staticd: Fix crash that occurs when modifying an SRv6 SID"

This reverts commit c80c2b2a4226640464a38f8ee9f8b2b4be8bd094.

4 weeks agoRevert "tests: Add test case to verify SRv6 SID modify"
Donatas Abraitis [Thu, 27 Mar 2025 11:35:35 +0000 (13:35 +0200)]
Revert "tests: Add test case to verify SRv6 SID modify"

This reverts commit 8f1313392f70ff2e7e8f924e238564879d5e3aeb.

4 weeks agoMerge pull request #18478 from FRRouting/mergify/bp/stable/10.3/pr-18467
Russ White [Tue, 25 Mar 2025 14:39:05 +0000 (10:39 -0400)]
Merge pull request #18478 from FRRouting/mergify/bp/stable/10.3/pr-18467

staticd: Fix a crash that occurs when modifying an SRv6 SID (backport #18467)

4 weeks agoMerge pull request #18485 from FRRouting/mergify/bp/stable/10.3/pr-18483
Donald Sharp [Tue, 25 Mar 2025 13:01:28 +0000 (09:01 -0400)]
Merge pull request #18485 from FRRouting/mergify/bp/stable/10.3/pr-18483

bgpd: Fix holdtime not working properly when busy (backport #18483)

5 weeks agobgpd: Fix holdtime not working properly when busy mergify/bp/stable/10.3/pr-18483 18485/head
Donald Sharp [Mon, 24 Mar 2025 18:28:38 +0000 (14:28 -0400)]
bgpd: Fix holdtime not working properly when busy

Commit:  cc9f21da2218d95567eff1501482ce58e6600f54

Modified the bgp_fsm code to dissallow the extension
of the hold time when the system is under extremely
heavy load.  This was a attempt to remove the return
code but it was too aggressive and messed up this bit
of code.

Put the behavior back that was introduced in:
d0874d195d0127009a7d9c06920c52c95319eff9

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

5 weeks agotests: Add test case to verify SRv6 SID modify 18478/head
Carmine Scarpitta [Sun, 23 Mar 2025 15:57:15 +0000 (16:57 +0100)]
tests: Add test case to verify SRv6 SID modify

This commit adds a test case that modifies a SID and verifies that the
RIB is as expected.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 23403e01a3ece0b206bc8acf36c08b4bb538cb79)

5 weeks agostaticd: Fix crash that occurs when modifying an SRv6 SID
Carmine Scarpitta [Sun, 23 Mar 2025 15:56:52 +0000 (16:56 +0100)]
staticd: Fix crash that occurs when modifying an SRv6 SID

When the user modifies an SRv6 SID and then removes all SIDs, staticd
crashes:

```
2025/03/23 08:37:22.691860 STATIC: lib/memory.c:74: mt_count_free(): assertion (mt->n_alloc) failed
STATIC: Received signal 6 at 1742715442 (si_addr 0x8200007cf0); aborting...
STATIC: zlog_signal+0x390                  fcc704a844b8     ffffd7450390 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: core_handler+0x1f8                 fcc704b79990     ffffd7450590 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC:     ---- signal ----
STATIC: ?                                  fcc705c008f8     ffffd74507a0 linux-vdso.so.1 (mapped at 0xfcc705c00000)
STATIC: pthread_key_delete+0x1a0           fcc70458f1f0     ffffd7451a00 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: raise+0x1c                         fcc70454a67c     ffffd7451ad0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: abort+0xe4                         fcc704537130     ffffd7451af0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: _zlog_assert_failed+0x3c4          fcc704c407c8     ffffd7451c40 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: mt_count_free+0x12c                fcc704a93c74     ffffd7451dc0 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: qfree+0x28                         fcc704a93fa0     ffffd7451e70 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: static_srv6_sid_free+0x1c          adc1df8fa544     ffffd7451e90 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: delete_static_srv6_sid+0x14        adc1df8faafc     ffffd7451eb0 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: list_delete_all_node+0x104         fcc704a60eec     ffffd7451ed0 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: list_delete+0x8c                   fcc704a61054     ffffd7451f00 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: static_srv6_cleanup+0x20           adc1df8fabdc     ffffd7451f20 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: sigint+0x40                        adc1df8be544     ffffd7451f30 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: frr_sigevent_process+0x148         fcc704b79460     ffffd7451f40 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: event_fetch+0x1c4                  fcc704bc0834     ffffd7451f60 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: frr_run+0x650                      fcc704a5d230     ffffd7452080 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: main+0x1d0                         adc1df8be75c     ffffd7452270 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: __libc_init_first+0x7c             fcc7045373fc     ffffd74522b0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: __libc_start_main+0x98             fcc7045374cc     ffffd74523c0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: _start+0x30                        adc1df8be0f0     ffffd7452420 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
```

Tracking this down, the crash occurs because every time we modify a
SID, staticd executes some callbacks to modify the SID and finally it
calls `apply_finish`, which re-adds the SID to the list `srv6_sids`.

This leads to having the same SID multiple times in the `srv6_sids`
list. When we delete all SIDs, staticd attempts to deallocate the same
SID multiple times, which leads to the crash.

This commit fixes the issue by moving the code that adds the SID to the
list from the `apply_finish` callback to the `create` callback.
This ensures that the SID is inserted into the list only once, when it
is created. For all subsequent modifications, the SID is modified but
not added to the list.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 6037ea350c98fbce60d0a287720cd4e60f7a21ec)

5 weeks agoMerge pull request #18463 from FRRouting/mergify/bp/stable/10.3/pr-18378
Donald Sharp [Sun, 23 Mar 2025 19:17:47 +0000 (15:17 -0400)]
Merge pull request #18463 from FRRouting/mergify/bp/stable/10.3/pr-18378

bgpd: fix `set evpn gateway-ip ipv[46]` route-map (backport #18378)

5 weeks agobgpd: fix evpn attributes being dropped on input mergify/bp/stable/10.3/pr-18378 18463/head
Tuetuopay [Mon, 17 Mar 2025 14:08:15 +0000 (15:08 +0100)]
bgpd: fix evpn attributes being dropped on input

All assignments of the EVPN attributes (ESI and Gateway IP) are gated
behind the peer being set up for inbound soft-reconfiguration.

There are no actual reasons for this limitation, so let's perform the
EVPN attribute assignment no matter what when soft reconfiguration is
not enabled.

Fixes: 6e076ba5231 ("bgpd: Fix for ain->attr corruption during path update")
Signed-off-by: Tuetuopay <tuetuopay@me.com>
(cherry picked from commit 7320659f78cbe86dd983d5101831120fc14583d7)

5 weeks agotests: add route-map evpn set gateway-ip topotest
Tuetuopay [Fri, 14 Mar 2025 19:21:53 +0000 (20:21 +0100)]
tests: add route-map evpn set gateway-ip topotest

This test does not actually look at the route since the gateway-ip is
not exposed in vtysh output. However, this ensures such a route-map does
not crash bgpd.

Signed-off-by: Tuetuopay <tuetuopay@me.com>
(cherry picked from commit 05a74323b9d440590074f22be11c34a605da69ad)

5 weeks agobgpd: fix `set evpn gateway-ip ipv[46]` route-map
Tuetuopay [Fri, 14 Mar 2025 19:21:46 +0000 (20:21 +0100)]
bgpd: fix `set evpn gateway-ip ipv[46]` route-map

The `route_set_evpn_gateway_ip` function copies `gw_ip->ip.addr` in the
route's gateway ip. In a nutshell, this skips the `ipa_type` field,
writing the actual IP in the IP type. This later rightfully trips
asserts about unknown IP types.

The following route-map...

```
route-map test permit 10
    set evpn gateway-ip ipv4 1.1.1.1
```

...will make the following gateway IP in the route:

```
(gdb) p/x a1->evpn_overlay->gw_ip
$11 = {ipa_type = 0x1010101, ip = {addr = 0x0, addrbytes = {
      0x0 <repeats 16 times>}, _v4_addr = {s_addr = 0x0}, _v6_addr = {
      __in6_u = {__u6_addr8 = {0x0 <repeats 16 times>}, __u6_addr16 = {0x0,
          0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, __u6_addr32 = {0x0, 0x0, 0x0,
          0x0}}}}}
```

We do indeed see the IP Address in the `ipa_type` field.

Fix by starting the memcpy at the root of `struct ipaddr` instead of
skipping the `ipa_type` field.

Fixes: d0a4ee6010a ("bgpd: Add "set evpn gateway-ip" clause for route-map")
Signed-off-by: Tuetuopay <tuetuopay@me.com>
(cherry picked from commit 0b0e7015971a788c14dd1dc9b5bac8cb66175c29)

5 weeks agoMerge pull request #18455 from FRRouting/mergify/bp/stable/10.3/pr-18108
Donald Sharp [Sat, 22 Mar 2025 19:23:23 +0000 (15:23 -0400)]
Merge pull request #18455 from FRRouting/mergify/bp/stable/10.3/pr-18108

zebra: Do not flush an existing vni configuration trying to remove wrong vni (backport #18108)

5 weeks agozebra: Do not flush an existing vni configuration trying to remove wrong vni mergify/bp/stable/10.3/pr-18108 18455/head
Donatas Abraitis [Tue, 11 Feb 2025 19:22:12 +0000 (21:22 +0200)]
zebra: Do not flush an existing vni configuration trying to remove wrong vni

Before:

```
pc.donatas.net(config)# do sh run | include vni
vni 1
pc.donatas.net(config)# no vni 2
pc.donatas.net(config)# do sh run | include vni
pc.donatas.net(config)#
```

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

5 weeks agoMerge pull request #18437 from FRRouting/mergify/bp/stable/10.3/pr-18435
Donald Sharp [Thu, 20 Mar 2025 12:26:50 +0000 (08:26 -0400)]
Merge pull request #18437 from FRRouting/mergify/bp/stable/10.3/pr-18435

bgpd: Fix leaked memory when showing some bgp routes (backport #18435)

5 weeks agoMerge pull request #18439 from Jafaral/rpm-fix
Donald Sharp [Thu, 20 Mar 2025 12:26:35 +0000 (08:26 -0400)]
Merge pull request #18439 from Jafaral/rpm-fix

Fix rpm packaging for 10.3 (manual backport #18426)

5 weeks agoredhat: Make sure zeromq is always disabled 18439/head
Martin Winter [Wed, 19 Mar 2025 12:40:53 +0000 (13:40 +0100)]
redhat: Make sure zeromq is always disabled

Fix issue where zeromq is getting enabled if build system has the libs
installed. For RPMs, we want it always based on intended config options.
(and currently the zeromq is not part of the packages)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 weeks agoredhat: Make docs and rpki optional for RPM package build
Martin Winter [Wed, 19 Mar 2025 06:21:37 +0000 (07:21 +0100)]
redhat: Make docs and rpki optional for RPM package build

Adding options to disable docs and rpki during the build. By
default they are always built. RPKI sub-package will not be built
(and not available) if built without the RPKI support.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 weeks agoRevert "redhat: Add option to build pkg without docs and rpki support, allow for...
Martin Winter [Wed, 19 Mar 2025 06:07:44 +0000 (07:07 +0100)]
Revert "redhat: Add option to build pkg without docs and rpki support, allow for different system environments by including all built .so files"

This reverts commit d89f21fc0602761f5adb0dd82b8c6e24a5636a20.

Reverting original change from PR 17793. This commit breaks RPKI
and SNMP sub-packages

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 weeks agobgpd: Fix leaked memory when showing some bgp routes 18437/head
Donald Sharp [Wed, 19 Mar 2025 20:50:11 +0000 (16:50 -0400)]
bgpd: Fix leaked memory when showing some bgp routes

The two memory leaks:

==387155== 744 (48 direct, 696 indirect) bytes in 1 blocks are definitely lost in loss record 222 of 262
==387155==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==387155==    by 0x4C1B982: json_object_new_object (in /usr/lib/x86_64-linux-gnu/libjson-c.so.5.1.0)
==387155==    by 0x2E4146: peer_adj_routes (bgp_route.c:15245)
==387155==    by 0x2E4F1A: show_ip_bgp_instance_neighbor_advertised_route_magic (bgp_route.c:15549)
==387155==    by 0x2B982B: show_ip_bgp_instance_neighbor_advertised_route (bgp_route_clippy.c:722)
==387155==    by 0x4915E6F: cmd_execute_command_real (command.c:1003)
==387155==    by 0x4915FE8: cmd_execute_command (command.c:1062)
==387155==    by 0x4916598: cmd_execute (command.c:1228)
==387155==    by 0x49EB858: vty_command (vty.c:626)
==387155==    by 0x49ED77C: vty_execute (vty.c:1389)
==387155==    by 0x49EFFA7: vtysh_read (vty.c:2408)
==387155==    by 0x49E4156: event_call (event.c:2019)
==387155==    by 0x4958ABD: frr_run (libfrr.c:1247)
==387155==    by 0x206A68: main (bgp_main.c:557)
==387155==
==387155== 2,976 (192 direct, 2,784 indirect) bytes in 4 blocks are definitely lost in loss record 240 of 262
==387155==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==387155==    by 0x4C1B982: json_object_new_object (in /usr/lib/x86_64-linux-gnu/libjson-c.so.5.1.0)
==387155==    by 0x2E45CA: peer_adj_routes (bgp_route.c:15325)
==387155==    by 0x2E4F1A: show_ip_bgp_instance_neighbor_advertised_route_magic (bgp_route.c:15549)
==387155==    by 0x2B982B: show_ip_bgp_instance_neighbor_advertised_route (bgp_route_clippy.c:722)
==387155==    by 0x4915E6F: cmd_execute_command_real (command.c:1003)
==387155==    by 0x4915FE8: cmd_execute_command (command.c:1062)
==387155==    by 0x4916598: cmd_execute (command.c:1228)
==387155==    by 0x49EB858: vty_command (vty.c:626)
==387155==    by 0x49ED77C: vty_execute (vty.c:1389)
==387155==    by 0x49EFFA7: vtysh_read (vty.c:2408)
==387155==    by 0x49E4156: event_call (event.c:2019)
==387155==    by 0x4958ABD: frr_run (libfrr.c:1247)
==387155==    by 0x206A68: main (bgp_main.c:557)

For the 1st one, if the operator issues a advertised-routes command, the
json_ar variable was never being freed.

For the 2nd one, if the operator issued a command where the
output_count_per_rd is 0, we need to free the json_routes value.

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

5 weeks agoMerge pull request #18433 from FRRouting/mergify/bp/stable/10.3/pr-18430
Donald Sharp [Thu, 20 Mar 2025 00:42:47 +0000 (20:42 -0400)]
Merge pull request #18433 from FRRouting/mergify/bp/stable/10.3/pr-18430

lib: Create VRF if needed (backport #18430)

5 weeks agolib: Create VRF if needed mergify/bp/stable/10.3/pr-18430 18433/head
Nathan Bahr [Wed, 19 Mar 2025 16:07:37 +0000 (16:07 +0000)]
lib: Create VRF if needed

When creating a control plane protocol through NB, create the vrf
if needed instead of only looking up and asserting if it doesn't
exist yet.
Fixes 18429.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
(cherry picked from commit b6ae01f907c071be6cd197df0f3ca6fe9baa631a)

5 weeks agoMerge pull request #18422 from FRRouting/mergify/bp/stable/10.3/pr-18393
Jafar Al-Gharaibeh [Wed, 19 Mar 2025 14:55:12 +0000 (09:55 -0500)]
Merge pull request #18422 from FRRouting/mergify/bp/stable/10.3/pr-18393

ospf6d: Disable and delete OSPFv3 areas that no longer have interfaces or configuration. (backport #18393)

5 weeks ago ospf6d: Disable and delete OSPFv3 areas that no longer have interfaces or configur... 18422/head
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>
(cherry picked from commit 04994891fe164b4d5a2819d3bc90e5346f94dc53)

6 weeks agoMerge pull request #18402 from FRRouting/mergify/bp/stable/10.3/pr-18387
Donald Sharp [Mon, 17 Mar 2025 12:15:46 +0000 (08:15 -0400)]
Merge pull request #18402 from FRRouting/mergify/bp/stable/10.3/pr-18387

bgpd: Fixed crash upon bgp network import-check command (backport #18387)

6 weeks agobgpd: Fixed crash upon bgp network import-check command 18402/head
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>
(cherry picked from commit bc1008b970541c090e36fc1d50c720df822fcb99)

6 weeks agoMerge pull request #18391 from FRRouting/mergify/bp/stable/10.3/pr-18360
Donatas Abraitis [Sat, 15 Mar 2025 17:33:01 +0000 (18:33 +0100)]
Merge pull request #18391 from FRRouting/mergify/bp/stable/10.3/pr-18360

zebra: ensure proper return for failure for Sid allocation (backport #18360)

6 weeks agozebra: ensure proper return for failure for Sid allocation 18391/head
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>
(cherry picked from commit 5a63cf4c0d1e7b84f59003877599c6575ba08a25)

7 weeks agoFRR Release 10.3 rc/10.3 docker/10.3.0 frr-10.3
Jafar Al-Gharaibeh [Mon, 10 Mar 2025 04:11:11 +0000 (23:11 -0500)]
FRR Release 10.3

- Major highlights:
-   Lua 5.4 support
-   Fixed CVE-2024-55553
-   New match community-count BGP command to limit communities count
-   New set metric igp|aigp BGP command to inject IGP metric as MED into BGP
-   New bgp ipv6-auto-ra BGP command
-   Optimize BGP EVPN L2VNI/L3VIN remote routes processing
-   Respect non-transitive BGP extended communities between direct peers
-   Drop deprecated bgp network import-check exact command
-   Handle BGP ENHE (Extended Next Hop Encoding) capability via dynamic capability
-   Implement BGP connect backoff retry
-   Implement an ability to import BMP information from a separate BGP instance
-   Add support of BGP color extended community color-only types
-   Implement SBFD
-   Add support for SRv6 static SIDs
-   Implement embedded-rp for PIMv6
-   Implement AutoRP mapping-agent for PIM
-   Implement MSDP peer SA limiting

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
7 weeks agodebian, redhat: updating changelog for new release
Jafar Al-Gharaibeh [Mon, 10 Mar 2025 04:08:40 +0000 (23:08 -0500)]
debian, redhat: updating changelog for new release

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
7 weeks agoMerge pull request #18353 from FRRouting/mergify/bp/dev/10.3/pr-18348
Jafar Al-Gharaibeh [Mon, 10 Mar 2025 03:22:38 +0000 (22:22 -0500)]
Merge pull request #18353 from FRRouting/mergify/bp/dev/10.3/pr-18348

Topotest startup order (backport #18348)

7 weeks agoMerge pull request #18352 from FRRouting/mergify/bp/dev/10.3/pr-18338
Jafar Al-Gharaibeh [Sun, 9 Mar 2025 17:34:29 +0000 (12:34 -0500)]
Merge pull request #18352 from FRRouting/mergify/bp/dev/10.3/pr-18338

Documentation typesafe (backport #18338)

7 weeks agotests: Have zebra startup look for the zserv.api socket 18353/head
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>
(cherry picked from commit 009f42dd5bd02eb5ee0bd9852704357c6bc7aaa1)

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>
(cherry picked from commit dd609bc069857a38ff3577b76d0b9ef708b8d2aa)

7 weeks agodoc: The sbfd documentation was not being included 18352/head
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>
(cherry picked from commit f1c75deb8e6581b0c3eb2129a61c017ca1d9be99)

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>
(cherry picked from commit 4738cb51d2019e8852887e97e9a0363ec29728a4)

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>
(cherry picked from commit 39909f9fb9459ce210cb44a10291a053d4fbb272)

7 weeks agoMerge pull request #18331 from FRRouting/mergify/bp/dev/10.3/pr-18214
Donald Sharp [Fri, 7 Mar 2025 01:33:21 +0000 (20:33 -0500)]
Merge pull request #18331 from FRRouting/mergify/bp/dev/10.3/pr-18214

zebra: Bring up 514 BGP neighbor sessions (backport #18214)

7 weeks agoMerge pull request #18332 from FRRouting/mergify/bp/dev/10.3/pr-18315
Donald Sharp [Fri, 7 Mar 2025 01:33:02 +0000 (20:33 -0500)]
Merge pull request #18332 from FRRouting/mergify/bp/dev/10.3/pr-18315

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

7 weeks agopimd: Fix PIM6 MLD VRF support (use recvmsg() pktinfo) 18332/head
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>
(cherry picked from commit 374c8dc4dbc8a560036fecdfb3213f690099b869)

7 weeks agotests: add support for 514 unnumbered/v4/v6 BGP sessions 18331/head
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>
(cherry picked from commit 10ff0d5e4cf08dacf2bf82b2350dac403633e380)

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>
(cherry picked from commit fd80124ccab4afed32c09437986ad1347440fc81)

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>
(cherry picked from commit 6a75d33b5cb9f5a87d71d169e24c1ae15e1bd896)

8 weeks agoMerge pull request #18302 from LabNConsulting/chopps/fix-nb-bugs
Jafar Al-Gharaibeh [Mon, 3 Mar 2025 18:59:48 +0000 (12:59 -0600)]
Merge pull request #18302 from LabNConsulting/chopps/fix-nb-bugs

Bring in 2 northbound bug-fixes from master to 10.3

8 weeks agolib: nb: fix bug with oper-state query on list data 18302/head
Christian Hopps [Wed, 26 Feb 2025 13:34:59 +0000 (13:34 +0000)]
lib: nb: fix bug with oper-state query on list data

The capacity of the xpath string was not guaranteed to be sufficient to hold all
the key predicates and so would truncate. Calculate the required space and
guarantee that it is available.

Signed-off-by: Christian Hopps <chopps@labn.net>
8 weeks agolib: nb: fix bug with keyless list specific index lookup
Christian Hopps [Mon, 3 Mar 2025 15:43:34 +0000 (15:43 +0000)]
lib: nb: fix bug with keyless list specific index lookup

Signed-off-by: Christian Hopps <chopps@labn.net>
8 weeks agoMerge pull request #18291 from FRRouting/mergify/bp/dev/10.3/pr-18290
Donald Sharp [Mon, 3 Mar 2025 15:35:27 +0000 (10:35 -0500)]
Merge pull request #18291 from FRRouting/mergify/bp/dev/10.3/pr-18290

tools: Fix `frr-reload.py` error related to `static-sids` (backport #18290)

8 weeks agoMerge pull request #18296 from FRRouting/mergify/bp/dev/10.3/pr-18294
Donald Sharp [Mon, 3 Mar 2025 15:34:34 +0000 (10:34 -0500)]
Merge pull request #18296 from FRRouting/mergify/bp/dev/10.3/pr-18294

isisd: Correct edge insertion into TED (backport #18294)

8 weeks agoMerge pull request #18292 from FRRouting/mergify/bp/dev/10.3/pr-18289
Donald Sharp [Mon, 3 Mar 2025 14:38:03 +0000 (09:38 -0500)]
Merge pull request #18292 from FRRouting/mergify/bp/dev/10.3/pr-18289

staticd: Fix `no srv6` command (backport #18289)

8 weeks agoisisd: Correct edge insertion into TED 18296/head
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>
(cherry picked from commit 605fc1dd6404b6ed51691c647568939adde4962a)

8 weeks agotests: Add test case to verify that SIDs can be re-added 18292/head
Carmine Scarpitta [Wed, 26 Feb 2025 15:08:33 +0000 (16:08 +0100)]
tests: Add test case to verify that SIDs can be re-added

Add a test case to verify that staticd is able to re-install all SIDs
after disabling and re-enabling SRv6.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 0e0eca6c5f287c936570a3be50dde120ade1b9b8)

8 weeks agotests: Add test case to verify `no srv6` command
Carmine Scarpitta [Wed, 26 Feb 2025 15:08:17 +0000 (16:08 +0100)]
tests: Add test case to verify `no srv6` command

Add a test case to verify that staticd removes all SIDs when the
`no srv6` command is executed.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 58373a61d559036990b875bbf0afdc9e92174975)

8 weeks agostaticd: Fix `no srv6` command
Carmine Scarpitta [Tue, 25 Feb 2025 23:24:49 +0000 (00:24 +0100)]
staticd: Fix `no srv6` command

A user can configure static SIDs as follows:

[...]
segment-routing
 srv6
  static-sids
   sid fcbb:bbbb:1::/48 locator MAIN behavior uN
   sid fcbb:bbbb:1:fe00::/64 locator MAIN behavior uDT46
[...]

When the user runs vtysh and executes the `no srv6` command, the
expectation is that staticd will deallocate all SIDs.

However, currently FRR does not behaves as expected. After the user
executes `no srv6`, the SIDs are still present.

The problem is that vtysh does not forward the `no srv6` command to
mgmtd/staticd.

The `no srv6` command is defined using the `DEFUN_YANG_NOSH` macro,
which instructs `xref2vtysh.py` to skip the `no srv6` command during
the generation of `vtysh_cmd.c`. As a result, vtysh is unaware that it
should forward the `no srv6` command to mgmtd/staticd.

This commit fixes the issue by replacing `DEFUN_YANG_NOSH` with
`DEFUN_YANG`. This change ensures that `xref2vtysh.py` includes the
`no srv6` command when generating `vtysh_cmd.c` and makes vtysh forward
the `no srv6` command to mgmtd/staticd.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit b94be4a1c5ad6de7547a64d20a2f5124780fe4e7)

8 weeks agotools: Fix `frr-reload.py` error related to `static-sids` 18291/head
Carmine Scarpitta [Sat, 1 Mar 2025 23:02:57 +0000 (00:02 +0100)]
tools: Fix `frr-reload.py` error related to `static-sids`

```
[...]
segment-routing
 srv6
  static-sids
   sid fcbb:bbbb:1::/48 locator MAIN behavior uN
   sid fcbb:bbbb:1:fe10::/64 locator MAIN behavior uDT4 vrf Vrf10
   sid fcbb:bbbb:1:fe20::/64 locator MAIN behavior uDT6 vrf Vrf20
   sid fcbb:bbbb:1:fe30::/64 locator MAIN behavior uDT46 vrf Vrf30
   sid fcbb:bbbb:1:fe40::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2
[...]
```

When the user has a configuration like the one above and runs the
command `frr-reload.py --reload`, the following error occurs:

```
[1129654|mgmtd] sending configuration
line 17: % Unknown command[76]:   sid fcbb:bbbb:1::/48 locator MAIN behavior uN
line 23: % Unknown command[76]:   sid fcbb:bbbb:1:fe10::/64 locator MAIN behavior uDT4 vrf Vrf10
line 29: % Unknown command[76]:   sid fcbb:bbbb:1:fe20::/64 locator MAIN behavior uDT6 vrf Vrf20
line 35: % Unknown command[76]:   sid fcbb:bbbb:1:fe30::/64 locator MAIN behavior uDT46 vrf Vrf30
line 41: % Unknown command[76]:   sid fcbb:bbbb:1:fe40::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2
```

The problem is that in `frr-reload-py` all commands that start a new
multi-line context must be included in the `ctx_keyword` dictionary.
However, the `static-sids` command is not part of the `ctx_keyword`
dictionary.

This commit fixes the problem by adding `static-sids` to `ctx_keyword`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit a515de1c46f617ee3608ab55cdef5f2a262d387a)

8 weeks agoMerge pull request #18265 from FRRouting/mergify/bp/dev/10.3/pr-18254
Jafar Al-Gharaibeh [Sat, 1 Mar 2025 21:02:53 +0000 (15:02 -0600)]
Merge pull request #18265 from FRRouting/mergify/bp/dev/10.3/pr-18254

ospf6d: Fix use after free of router in OSPFv3 ABR route calculation. (backport #18254)

8 weeks agoMerge pull request #18284 from FRRouting/mergify/bp/dev/10.3/pr-18263
Jafar Al-Gharaibeh [Fri, 28 Feb 2025 20:46:40 +0000 (14:46 -0600)]
Merge pull request #18284 from FRRouting/mergify/bp/dev/10.3/pr-18263

staticd: Add `no` form for `static-sids` command (backport #18263)