]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
2 weeks agobgpd: On shutdown free up table for static routes
Donald Sharp [Wed, 9 Apr 2025 13:28:31 +0000 (09:28 -0400)]
bgpd: On shutdown free up table for static routes

Indirect leak of 56 byte(s) in 1 object(s) allocated from:
    0 0x7fdaf6cb83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    1 0x7fdaf683a480 in qcalloc lib/memory.c:106
    2 0x7fdaf68dd706 in route_table_init_with_delegate lib/table.c:38
    3 0x5649b22c05b0 in bgp_table_init bgpd/bgp_table.c:139
    4 0x5649b2273da0 in bgp_static_set bgpd/bgp_route.c:7779
    5 0x5649b21eba58 in vpnv4_network bgpd/bgp_mplsvpn.c:3244
    6 0x7fdaf67b6d61 in cmd_execute_command_real lib/command.c:1003
    7 0x7fdaf67b7080 in cmd_execute_command lib/command.c:1062
    8 0x7fdaf67b75ac in cmd_execute lib/command.c:1228
    9 0x7fdaf68ffb20 in vty_command lib/vty.c:626
    10 0x7fdaf6900073 in vty_execute lib/vty.c:1389
    11 0x7fdaf6903e24 in vtysh_read lib/vty.c:2408
    12 0x7fdaf68f0222 in event_call lib/event.c:2019
    13 0x7fdaf681b3c6 in frr_run lib/libfrr.c:1247
    14 0x5649b211c903 in main bgpd/bgp_main.c:565
    15 0x7fdaf630c249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Table was being created but never deleted.  Let's delete it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 weeks agoMerge pull request #18604 from y-bharath14/srib-yang-v9
Christian Hopps [Wed, 9 Apr 2025 10:24:22 +0000 (06:24 -0400)]
Merge pull request #18604 from y-bharath14/srib-yang-v9

yang: Pyang errors in frr-bfdd.yang

2 weeks agoMerge pull request #17915 from mjstapp/compile_wshadow
David Lamparter [Wed, 9 Apr 2025 07:59:06 +0000 (09:59 +0200)]
Merge pull request #17915 from mjstapp/compile_wshadow

2 weeks agoMerge pull request #18614 from donaldsharp/bgp_memory_fixes_vrf_different_asn
Jafar Al-Gharaibeh [Tue, 8 Apr 2025 19:31:15 +0000 (14:31 -0500)]
Merge pull request #18614 from donaldsharp/bgp_memory_fixes_vrf_different_asn

bgpd: On shutdown free up memory leak found by topotest

2 weeks agolib,ripd: resolve clang SA warnings
Mark Stapp [Thu, 27 Mar 2025 19:16:05 +0000 (15:16 -0400)]
lib,ripd: resolve clang SA warnings

Looks like there were a couple of SA warnings lurking; fix
them.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agotests: clean up variable-shadow warnings
Mark Stapp [Thu, 27 Mar 2025 17:29:24 +0000 (13:29 -0400)]
tests: clean up variable-shadow warnings

Clean up -Wshadow warnings in unit-tests

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agotools,pceplib,ospfclient: clean up variable-shadow warnings
Mark Stapp [Thu, 27 Mar 2025 16:56:28 +0000 (12:56 -0400)]
tools,pceplib,ospfclient: clean up variable-shadow warnings

Clean up -Wshadow warnings in these components

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agopbrd,staticd,vrrpd: clean up variable-shadow warnings
Mark Stapp [Thu, 27 Mar 2025 15:18:34 +0000 (11:18 -0400)]
pbrd,staticd,vrrpd: clean up variable-shadow warnings

Clean up -Wshadow warnings in three daemons

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agosharpd: clean up variable-shadowing compiler warnings
Mark Stapp [Thu, 27 Mar 2025 15:08:51 +0000 (11:08 -0400)]
sharpd: clean up variable-shadowing compiler warnings

Clean up -Wshadow in sharpd

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agobgpd: clean up variable-shadowing compiler warnings
Mark Stapp [Thu, 27 Mar 2025 12:56:43 +0000 (08:56 -0400)]
bgpd: clean up variable-shadowing compiler warnings

Clean up -Wshadow warnings in bgp.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agopimd: clean up variable-shadow warnings
Mark Stapp [Wed, 26 Mar 2025 19:27:09 +0000 (15:27 -0400)]
pimd: clean up variable-shadow warnings

Clean up -Wshadow warnings in pimd

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agozebra: clean up -Wshadow compiler warnings
Mark Stapp [Wed, 26 Mar 2025 18:54:30 +0000 (14:54 -0400)]
zebra: clean up -Wshadow compiler warnings

Clean up variable-shadowing compiler warnings.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agoripng: clean up -Wshadow compiler warnings
Mark Stapp [Wed, 26 Mar 2025 17:44:55 +0000 (13:44 -0400)]
ripng: clean up -Wshadow compiler warnings

Clean up -Wshadow compiler warnings.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agolib,ripd: clean up -Wshadow compiler warnings
Mark Stapp [Wed, 26 Mar 2025 17:40:59 +0000 (13:40 -0400)]
lib,ripd: clean up -Wshadow compiler warnings

Clean up compiler warnings; convert a linklist macro
to an inline to resolve one; clean up a side-effect in isisd.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agonhrpd: clean up -Wshadow compiler warnings
Mark Stapp [Wed, 26 Mar 2025 16:52:48 +0000 (12:52 -0400)]
nhrpd: clean up -Wshadow compiler warnings

Clean up compiler warnings.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agopathd: clean up variable-shadow warnings
Mark Stapp [Thu, 30 Jan 2025 22:46:15 +0000 (17:46 -0500)]
pathd: clean up variable-shadow warnings

Clean up various variable-shadow warnings from -Wshadow

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agovtysh: clean up variable-shadow warnings
Mark Stapp [Thu, 30 Jan 2025 22:30:42 +0000 (17:30 -0500)]
vtysh: clean up variable-shadow warnings

Clean up various variable-shadowing warnings from -Wshadow

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agomgmtd: clean up -Wshadow warnings
Mark Stapp [Fri, 24 Jan 2025 20:20:48 +0000 (15:20 -0500)]
mgmtd: clean up -Wshadow warnings

Clean up various variable-shadow warnings in mgmtd.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agoldpd: clean up warnings from -Wshadow
Mark Stapp [Fri, 24 Jan 2025 20:13:37 +0000 (15:13 -0500)]
ldpd: clean up warnings from -Wshadow

Clean up various variable-shadow warnings in ldpd.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agoeigrpd: clean up variable-shadow warnings
Mark Stapp [Fri, 24 Jan 2025 19:59:04 +0000 (14:59 -0500)]
eigrpd: clean up variable-shadow warnings

Clean up various warnings from -Wshadow in eigrp.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agobfdd: clean up -Wshadow warnings
Mark Stapp [Fri, 24 Jan 2025 19:51:39 +0000 (14:51 -0500)]
bfdd: clean up -Wshadow warnings

Clean up various variable-shadow warnings in bfdd.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agobabeld: clean up -Wshadow warnings
Mark Stapp [Fri, 24 Jan 2025 19:44:46 +0000 (14:44 -0500)]
babeld: clean up -Wshadow warnings

Clean up various "shadow" warnings in babeld.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agoospf6: clean up -Wshadow warnings
Mark Stapp [Thu, 23 Jan 2025 20:42:52 +0000 (15:42 -0500)]
ospf6: clean up -Wshadow warnings

Clean up various "shadow" warnings.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agoospfd: clean up -Wshadow warnings
Mark Stapp [Thu, 23 Jan 2025 20:14:49 +0000 (15:14 -0500)]
ospfd: clean up -Wshadow warnings

Clean up various "shadow" warnings.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agoisisd: clean up -Wshadow warnings
Mark Stapp [Thu, 23 Jan 2025 18:16:11 +0000 (13:16 -0500)]
isisd: clean up -Wshadow warnings

Clean up various "shadow" warnings.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agolib: fix -Wshadow warnings in the lib modules
Mark Stapp [Thu, 30 Jan 2025 16:39:00 +0000 (11:39 -0500)]
lib: fix -Wshadow warnings in the lib modules

Fix various "shadow" warnings in lib.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agolib: don't shadow `_once` in `frr_with_mutex`
David Lamparter [Tue, 28 Jan 2025 01:58:09 +0000 (02:58 +0100)]
lib: don't shadow `_once` in `frr_with_mutex`

The `_once` loop variable will result in a `-Wshadow` warning when that
is turned on.  Use `__COUNTER__` to give these variables distinct names,
like is already done with `_mtx_`.

(and because I touched it, clang-format wants it reformatted... ohwell.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 weeks agoconfigure: add -Wshadow option
Mark Stapp [Thu, 23 Jan 2025 20:43:55 +0000 (15:43 -0500)]
configure: add -Wshadow option

Start exposing variable-shadowing warnings in all builds.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 weeks agoMerge pull request #18583 from zmw12306/source_port
Jafar Al-Gharaibeh [Tue, 8 Apr 2025 17:28:58 +0000 (12:28 -0500)]
Merge pull request #18583 from zmw12306/source_port

babeld: check valid babel port

2 weeks agoMerge pull request #18598 from zmw12306/nhrp_nexthop
Jafar Al-Gharaibeh [Tue, 8 Apr 2025 16:28:57 +0000 (11:28 -0500)]
Merge pull request #18598 from zmw12306/nhrp_nexthop

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

2 weeks agobgpd: On shutdown free up memory leak found by topotest
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>
2 weeks agoMerge pull request #18526 from donaldsharp/pim_leakage
Jafar Al-Gharaibeh [Tue, 8 Apr 2025 15:19:33 +0000 (10:19 -0500)]
Merge pull request #18526 from donaldsharp/pim_leakage

pimd: Fix memory leak on shutdown

2 weeks agoMerge pull request #18602 from LabNConsulting/chopps/doc-diagram
Russ White [Tue, 8 Apr 2025 15:12:05 +0000 (11:12 -0400)]
Merge pull request #18602 from LabNConsulting/chopps/doc-diagram

doc: add a diagram for config datastore cleanup on file reads

3 weeks agoMerge pull request #18585 from zmw12306/babel-knownae
Russ White [Tue, 8 Apr 2025 14:55:24 +0000 (10:55 -0400)]
Merge pull request #18585 from zmw12306/babel-knownae

babel: fix incorrect check in known_ae()

3 weeks agoMerge pull request #18584 from zmw12306/babel_get_myid
Russ White [Tue, 8 Apr 2025 14:54:50 +0000 (10:54 -0400)]
Merge pull request #18584 from zmw12306/babel_get_myid

babeld: Add a check to prevent all-ones case

3 weeks agoMerge pull request #18582 from zmw12306/route_lost
Russ White [Tue, 8 Apr 2025 14:52:39 +0000 (10:52 -0400)]
Merge pull request #18582 from zmw12306/route_lost

babeld: Fix starvation handling on route loss per RFC 8966 §3.8.2.1

3 weeks agoMerge pull request #18581 from zmw12306/request_forward
Russ White [Tue, 8 Apr 2025 14:52:08 +0000 (10:52 -0400)]
Merge pull request #18581 from zmw12306/request_forward

babeld: Request forwarding does not prioritize feasible routes

3 weeks agoMerge pull request #18547 from zmw12306/Hop-Count
Russ White [Tue, 8 Apr 2025 14:31:01 +0000 (10:31 -0400)]
Merge pull request #18547 from zmw12306/Hop-Count

babeld: Hop Count must not be 0.

3 weeks agoMerge pull request #18580 from raja-rajasekar/rajasekarr/check_sid_loc_block_beforehand
Carmine Scarpitta [Tue, 8 Apr 2025 12:53:26 +0000 (14:53 +0200)]
Merge pull request #18580 from raja-rajasekar/rajasekarr/check_sid_loc_block_beforehand

staticd: Avoid requesting SRv6 sid from zebra when loc and sid block dont match

3 weeks agoyang: Pyang errors in frr-bfdd.yang
Y Bharath [Tue, 8 Apr 2025 08:57:28 +0000 (14:27 +0530)]
yang: Pyang errors in frr-bfdd.yang

Corrected pyang errors in frr-bfdd.yang

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
3 weeks agodoc: add a diagram for config datastore cleanup on file reads
Christian Hopps [Tue, 8 Apr 2025 07:04:19 +0000 (07:04 +0000)]
doc: add a diagram for config datastore cleanup on file reads

Signed-off-by: Christian Hopps <chopps@labn.net>
3 weeks agonhrpd: Add Hop Count Validation Before Forwarding in nhrp_peer_recv()
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>
3 weeks agostaticd: Avoid requesting SRv6 sid from zebra when loc and sid block dont match
Rajasekar Raja [Fri, 4 Apr 2025 20:27:03 +0000 (13:27 -0700)]
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>
3 weeks agoMerge pull request #18558 from spoignant-proton/master
Donatas Abraitis [Mon, 7 Apr 2025 00:27:02 +0000 (03:27 +0300)]
Merge pull request #18558 from spoignant-proton/master

bgpd: flowspec: remove sizelimit check applied to the wrong length field (issue 18557)

3 weeks agobabel: fix incorrect check in known_ae()
zmw12306 [Sat, 5 Apr 2025 19:24:06 +0000 (15:24 -0400)]
babel: fix incorrect check in known_ae()

The known_ae() function accepts AE values up to 4, but the RFC only defines AE values 0-3.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
3 weeks agobabeld: Add a check to prevent all-ones case
zmw12306 [Sat, 5 Apr 2025 19:21:27 +0000 (15:21 -0400)]
babeld: Add a check to prevent all-ones case

A router-id MUST NOT consist of either all binary zeroes (0000000000000000 hexadecimal) or all binary ones (FFFFFFFFFFFFFFFF hexadecimal).

Signed-off-by: zmw12306 <zmw12306@gmail.com>
3 weeks agobabeld: check valid babel port
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>
3 weeks agobabeld: Fix starvation handling on route loss per RFC 8966 §3.8.2.1
zmw12306 [Sat, 5 Apr 2025 18:26:32 +0000 (14:26 -0400)]
babeld: Fix starvation handling on route loss per RFC 8966 §3.8.2.1

When all feasible routes to a destination are lost, but unexpired unfeasible routes exist, the node MUST send a seqno request to prevent starvation.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
3 weeks agobabeld: Request forwarding does not prioritize feasible routes
zmw12306 [Sat, 5 Apr 2025 18:00:41 +0000 (14:00 -0400)]
babeld: Request forwarding does not prioritize feasible routes

Modify route selection to check feasibility first, then fall back to non-feasible routes as per SHOULD requirement.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
3 weeks agoMerge pull request #18562 from opensourcerouting/fix/bfd_down_if_established
Mark Stapp [Fri, 4 Apr 2025 16:28:18 +0000 (12:28 -0400)]
Merge pull request #18562 from opensourcerouting/fix/bfd_down_if_established

bgpd: Treat the peer as not active due to BFD down only if established

3 weeks agobgpd: flowspec: remove sizelimit check applied to the wrong length field (issue 18557)
Stephane Poignant [Tue, 1 Apr 2025 16:56:27 +0000 (18:56 +0200)]
bgpd: flowspec: remove sizelimit check applied to the wrong length field (issue 18557)

Section 4.1 of RFC8955 defines how the length field of flowspec NLRIs is encoded.
The method use implies a maximum length of 4095 for a single flowspec NLRI.
However, in bgp_flowspec.c, we check the length attribute of the bgp_nlri structure against this maximum value, which actually is the *total* length of all NLRI included in the considered MP_REACH_NLRI path attribute.
Due to this confusion, frr would reject valid announces that contain many flowspec NLRIs, when their cummulative length exceeds 4095, and close the session.
The proposed change removes that check entirely. Indeed, there is no need to check the length field of each invidual NLRI because the method employed make it impossible to encode a length greater than 4095.

Signed-off-by: Stephane Poignant <stephane.poignant@proton.ch>
3 weeks agoMerge pull request #18567 from nabahr/proxy_init_disable
Donatas Abraitis [Thu, 3 Apr 2025 23:10:35 +0000 (02:10 +0300)]
Merge pull request #18567 from nabahr/proxy_init_disable

pimd: Initialize gm proxy to false

3 weeks agoMerge pull request #18572 from opensourcerouting/fix/syntax_error_bgp_gr_notification
Mark Stapp [Thu, 3 Apr 2025 14:32:05 +0000 (10:32 -0400)]
Merge pull request #18572 from opensourcerouting/fix/syntax_error_bgp_gr_notification

tests: Fix typo when configuring delayopen timer

3 weeks agoMerge pull request #18546 from LabNConsulting/ziemba/250330-rfapi-mem-cleanup
Mark Stapp [Thu, 3 Apr 2025 13:01:35 +0000 (09:01 -0400)]
Merge pull request #18546 from LabNConsulting/ziemba/250330-rfapi-mem-cleanup

bgpd: rfapi: track outstanding rib and import timers, free mem at exit

3 weeks agoMerge pull request #18396 from pguibert6WIND/srv6l3vpn_to_bgp_vrf_redistribute
Russ White [Thu, 3 Apr 2025 12:25:32 +0000 (08:25 -0400)]
Merge pull request #18396 from pguibert6WIND/srv6l3vpn_to_bgp_vrf_redistribute

Add BGP redistribution in SRv6 BGP

3 weeks agotests: Fix typo when configuring delayopen timer
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>
3 weeks agoMerge pull request #18553 from y-bharath14/srib-tests-v9
Donatas Abraitis [Thu, 3 Apr 2025 08:08:37 +0000 (11:08 +0300)]
Merge pull request #18553 from y-bharath14/srib-tests-v9

tests: Resource leaks in test_all_protocol_startup

3 weeks agoMerge pull request #18564 from routingrocks/rvaratharaj/bug_fix_bgp
Donatas Abraitis [Thu, 3 Apr 2025 06:46:34 +0000 (09:46 +0300)]
Merge pull request #18564 from routingrocks/rvaratharaj/bug_fix_bgp

bgpd: Skip EVPN MAC processing for non-EVPN peers

3 weeks agopimd: Initialize gm proxy to false
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>
3 weeks agoMerge pull request #18525 from donaldsharp/eigrp_coverity_newly_found
Jafar Al-Gharaibeh [Wed, 2 Apr 2025 19:13:37 +0000 (14:13 -0500)]
Merge pull request #18525 from donaldsharp/eigrp_coverity_newly_found

eigrpd: Fix possible use after free in nbr deletion

3 weeks agoMerge pull request #18561 from opensourcerouting/fix/ipv6_duplicate_check
Jafar Al-Gharaibeh [Wed, 2 Apr 2025 19:08:12 +0000 (14:08 -0500)]
Merge pull request #18561 from opensourcerouting/fix/ipv6_duplicate_check

lib: Return duplicate ipv6 prefix-list entry test

3 weeks agobgpd: Skip EVPN MAC processing for non-EVPN peers
Rajesh Varatharaj [Wed, 2 Apr 2025 18:48:35 +0000 (11:48 -0700)]
bgpd: Skip EVPN MAC processing for non-EVPN peers

Issue:
"Processing EVPN MAC interface change on peer" log message is printed
even when the peer didnt have EVPN address family.

Fix:
Process only if the peer is in EVPN address family

Ticket: #17890
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
3 weeks agobgpd: Treat the peer as not active due to BFD down only if established
Donatas Abraitis [Wed, 2 Apr 2025 14:24:09 +0000 (17:24 +0300)]
bgpd: Treat the peer as not active due to BFD down only if established

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: Donatas Abraitis <donatas@opensourcerouting.org>
3 weeks agoMerge pull request #18097 from louis-6wind/attrhash_cmp
Russ White [Wed, 2 Apr 2025 12:25:35 +0000 (08:25 -0400)]
Merge pull request #18097 from louis-6wind/attrhash_cmp

bgpd: optimize attrhash_cmp calls

3 weeks agolib: Return duplicate ipv6 prefix-list entry test
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>
3 weeks agoMerge pull request #18543 from y-bharath14/srib-yang-v8
Russ White [Tue, 1 Apr 2025 21:30:30 +0000 (17:30 -0400)]
Merge pull request #18543 from y-bharath14/srib-yang-v8

yang: Corrected pyang errors in frr-zebra.yang

4 weeks agobgpd: optimize attrhash_cmp calls
Louis Scalbert [Tue, 11 Feb 2025 16:00:25 +0000 (17:00 +0100)]
bgpd: optimize attrhash_cmp calls

Only call attrhash_cmp when necessary.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
4 weeks agoMerge pull request #18524 from donaldsharp/eigrp_limit_asn_vrf
Russ White [Tue, 1 Apr 2025 14:22:21 +0000 (10:22 -0400)]
Merge pull request #18524 from donaldsharp/eigrp_limit_asn_vrf

yang: Limit eigrp to just 1 instance per vrf

4 weeks agoMerge pull request #18470 from zmw12306/NH_Init
Russ White [Tue, 1 Apr 2025 14:13:11 +0000 (10:13 -0400)]
Merge pull request #18470 from zmw12306/NH_Init

babeld: Add next hop initialization

4 weeks agoMerge pull request #18450 from donaldsharp/bgp_packet_reads
Russ White [Tue, 1 Apr 2025 14:12:37 +0000 (10:12 -0400)]
Merge pull request #18450 from donaldsharp/bgp_packet_reads

Bgp packet reads conversion to a FIFO

4 weeks agotests: Resource leaks in test_all_protocol_startup
Y Bharath [Tue, 1 Apr 2025 06:36:15 +0000 (12:06 +0530)]
tests: Resource leaks in test_all_protocol_startup

Fix resource leaks in test_all_protocol_startup.py

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
4 weeks agobgpd: rfapi: track outstanding rib and import timers, free mem at exit
G. Paul Ziemba [Sun, 30 Mar 2025 22:43:04 +0000 (15:43 -0700)]
bgpd: rfapi: track outstanding rib and import timers, free mem at exit

    While here, also make "VPN SAFI clear" test wait for clear result
    (tests/topotests/bgp_rfapi_basic_sanity{,_config2})

    Original RFAPI code relied on the frr timer system to remember
    various allocations that were supposed to be freed at future times
    rather than manage a parallel database. However, if bgpd is terminated
    before the times expire, those pending allocations are marked as
    memory leaks, even though they wouldn't be leaks under normal operation.

    This change adds some hash tables to track these outstanding
    allocations that are associated with pending timers, and uses
    those tables to free the allocations when bgpd exits.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
4 weeks agoMerge pull request #18544 from donaldsharp/memory_leaks_all_over
Donatas Abraitis [Mon, 31 Mar 2025 11:50:59 +0000 (14:50 +0300)]
Merge pull request #18544 from donaldsharp/memory_leaks_all_over

Memory leaks all over

4 weeks agobabeld: Hop Count must not be 0.
zmw12306 [Mon, 31 Mar 2025 04:01:53 +0000 (00:01 -0400)]
babeld: Hop Count must not be 0.

According to RFC 8966:
Hop Count The maximum number of times that this TLV may be forwarded, plus 1. This MUST NOT be 0.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
4 weeks agobgpd: Free memory associated with aspath_dup
Donald Sharp [Sat, 29 Mar 2025 16:02:11 +0000 (12:02 -0400)]
bgpd: Free memory associated with aspath_dup

Fix this:

==3890443== 92 (48 direct, 44 indirect) bytes in 1 blocks are definitely lost in loss record 68 of 98
==3890443==    at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==3890443==    by 0x49737B3: qcalloc (memory.c:106)
==3890443==    by 0x3EA63B: aspath_dup (bgp_aspath.c:703)
==3890443==    by 0x2F5438: route_set_aspath_exclude (bgp_routemap.c:2604)
==3890443==    by 0x49BC52A: route_map_apply_ext (routemap.c:2708)
==3890443==    by 0x2C1069: bgp_input_modifier (bgp_route.c:1925)
==3890443==    by 0x2C9F12: bgp_update (bgp_route.c:5205)
==3890443==    by 0x2CF281: bgp_nlri_parse_ip (bgp_route.c:7271)
==3890443==    by 0x2A28C7: bgp_nlri_parse (bgp_packet.c:338)
==3890443==    by 0x2A7F5C: bgp_update_receive (bgp_packet.c:2448)
==3890443==    by 0x2ACCA6: bgp_process_packet (bgp_packet.c:4046)
==3890443==    by 0x49EB77C: event_call (event.c:2019)
==3890443==    by 0x495FAD1: frr_run (libfrr.c:1247)
==3890443==    by 0x208D6D: main (bgp_main.c:557)

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 weeks agozebra: Clean up memory associated with affinity maps
Donald Sharp [Sat, 29 Mar 2025 00:08:35 +0000 (20:08 -0400)]
zebra: Clean up memory associated with affinity maps

Zebra is using affinity maps but not cleaning up memory on shutdown.
BAD!

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 weeks agoisisd: Tie isis into cleaning up affinity maps
Donald Sharp [Sat, 29 Mar 2025 00:04:22 +0000 (20:04 -0400)]
isisd: Tie isis into cleaning up affinity maps

Affinity maps are abeing leaked.  STOP

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 weeks agolib: Add a affinity_map_terminate() function
Donald Sharp [Sat, 29 Mar 2025 00:03:50 +0000 (20:03 -0400)]
lib: Add a affinity_map_terminate() function

This function will clean up memory associated with affinity maps
on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 weeks ago*: Ensure prefix lists are freed on shutdown.
Donald Sharp [Fri, 28 Mar 2025 21:17:37 +0000 (17:17 -0400)]
*: Ensure prefix lists are freed on shutdown.

Several daemons were not calling prefix_list_reset
to clean up memory on shutdown.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 weeks agobgpd: On shutdown, unlock table when clearing the bgp metaQ
Donald Sharp [Fri, 28 Mar 2025 18:58:01 +0000 (14:58 -0400)]
bgpd: On shutdown, unlock table when clearing the bgp metaQ

There are some tables not being freed upon shutdown.  This
is happening because the table is being locked as dests
are being put on the metaQ.  When in shutdown it was clearing
the MetaQ it was not unlocking the table

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 weeks agobgpd: When shutting down do not clear self peers
Donald Sharp [Fri, 28 Mar 2025 18:54:37 +0000 (14:54 -0400)]
bgpd: When shutting down do not clear self peers

Commit: e0ae285eb8beeef7b43bdadc073d8ae346eaeb6c

Modified the fsm state machine to attempt to not
clear routes on a peer that was not established.
The peer should be not a peer self.  We do not want
to ever clear the peer self.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 weeks agoMerge pull request #15471 from opensourcerouting/frrreload_logfile
Christian Hopps [Sun, 30 Mar 2025 09:52:43 +0000 (05:52 -0400)]
Merge pull request #15471 from opensourcerouting/frrreload_logfile

tools: Add option to frr-reload to specify alternate logfile

4 weeks agopimd: Fix memory leak on shutdown
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>
4 weeks agoyang: Corrected pyang errors in frr-zebra.yang
Y Bharath [Sat, 29 Mar 2025 14:01:54 +0000 (19:31 +0530)]
yang: Corrected pyang errors in frr-zebra.yang

Corrected pyang warnings or errors in frr-zebra.yang

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
4 weeks agoMerge pull request #18532 from y-bharath14/srib-tests-v8
Donatas Abraitis [Fri, 28 Mar 2025 10:38:07 +0000 (12:38 +0200)]
Merge pull request #18532 from y-bharath14/srib-tests-v8

tests: Irrelevant code in lutil.py

4 weeks agotests: Irrelevant code in lutil.py
Y Bharath [Fri, 28 Mar 2025 05:22:36 +0000 (10:52 +0530)]
tests: Irrelevant code in lutil.py

Irrelevant code in lutil.py

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
4 weeks agoeigrpd: Fix possible use after free in nbr deletion
Donald Sharp [Thu, 27 Mar 2025 13:03:52 +0000 (09:03 -0400)]
eigrpd: Fix possible use after free in nbr deletion

Coverity is complaining about use after free's in
clearing eigrp neighbors.  Clean the code
up to not have the problem.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 weeks agoMerge pull request #18520 from y-bharath14/srib-tests-v7
Donatas Abraitis [Thu, 27 Mar 2025 13:07:45 +0000 (15:07 +0200)]
Merge pull request #18520 from y-bharath14/srib-tests-v7

tests: Fix potential issues at send_bsr_packet.py

4 weeks agoyang: Limit eigrp to just 1 instance per vrf
Donald Sharp [Thu, 27 Mar 2025 12:51:05 +0000 (08:51 -0400)]
yang: Limit eigrp to just 1 instance per vrf

Currently EIGRP has built in yang code that expects only
1 ASN used per vrf.  Let's just limit the operator from
putting themselves in a bad position by allowing something like
this:

router eigrp 33
....
!
router eigrp 99
...
!

no router eigrp 99 would crash because of assumptions
made in the yang processing.

Let's just hard code that assumption into the EIGRP yang
at the moment such that it will not allow you to enter
a `router eigrp 99` instance at all.

This is purely a software limitation to prevent the code
from violating it's current assumptions.  I do not see
much need to support this at this point in time so I
fixed the problem this way instead of having to possibly
touch a bunch of code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 weeks agoMerge pull request #18515 from donaldsharp/route_map_show_fix
Donatas Abraitis [Thu, 27 Mar 2025 07:13:51 +0000 (09:13 +0200)]
Merge pull request #18515 from donaldsharp/route_map_show_fix

lib: `show route-map` should not print (null)

4 weeks agotests: Fix potential issues at send_bsr_packet.py
Y Bharath [Thu, 27 Mar 2025 04:00:40 +0000 (09:30 +0530)]
tests: Fix potential issues at send_bsr_packet.py

Fix potential issues at send_bsr_packet.py

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
4 weeks agolib: `show route-map` should not print (null)
Donald Sharp [Wed, 26 Mar 2025 18:35:13 +0000 (14:35 -0400)]
lib: `show route-map` should not print (null)

This command:
route-map FOOBAR permit 10
 set ipv6 next-hop prefer-global
 set community 5060:12345 additive
!

When you issue a `show route-map ...` command displays this:

route-map: FOOBAR Invoked: 0 (0 milliseconds total) Optimization: enabled Processed Change: false
 permit, sequence 5 Invoked 0 (0 milliseconds total)
  Match clauses:
  Set clauses:
    ipv6 next-hop prefer-global (null)
    community 5060:12345 additive
  Call clause:
  Action:
    Exit routemap

Modify the code so that it no longer displays the NULL when there
is nothing to display.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 weeks agoMerge pull request #18498 from opensourcerouting/fix/keep_stale_routes_on_clear
Russ White [Wed, 26 Mar 2025 18:02:52 +0000 (14:02 -0400)]
Merge pull request #18498 from opensourcerouting/fix/keep_stale_routes_on_clear

bgpd: Retain the routes if we do a clear with N-bit set for Graceful-Restart

4 weeks agoMerge pull request #18508 from donaldsharp/rip_snmp_test_fixup
Jafar Al-Gharaibeh [Wed, 26 Mar 2025 17:38:05 +0000 (12:38 -0500)]
Merge pull request #18508 from donaldsharp/rip_snmp_test_fixup

tests: Modify simple_snmp_test to use frr.conf

4 weeks agoMerge pull request #18502 from opensourcerouting/fix/mpls_withdraw_label
Donald Sharp [Wed, 26 Mar 2025 15:26:19 +0000 (11:26 -0400)]
Merge pull request #18502 from opensourcerouting/fix/mpls_withdraw_label

bgpd: Set the label for MP_UNREACH_NLRI 0x800000 instead of 0x000000

4 weeks agotests: Modify simple_snmp_test to use frr.conf
Donald Sharp [Wed, 26 Mar 2025 15:14:57 +0000 (11:14 -0400)]
tests: Modify simple_snmp_test to use frr.conf

The simple_snmp_test was not properly testing
the rip snmp code because of weirdness w/ mgmtd
and non-integrated configs.  Modify the whole
test to use a integrated config and voila
ripd is talking snmp again in the test.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 weeks agoMerge pull request #18500 from y-bharath14/srib-yang-v7
Donald Sharp [Wed, 26 Mar 2025 14:51:10 +0000 (10:51 -0400)]
Merge pull request #18500 from y-bharath14/srib-yang-v7

yang: Fixed pyang errors at frr-isisd.yang

4 weeks agoMerge pull request #18506 from donaldsharp/ripng_test_aggregate_address
Russ White [Wed, 26 Mar 2025 14:31:59 +0000 (10:31 -0400)]
Merge pull request #18506 from donaldsharp/ripng_test_aggregate_address

tests: Add ripng aggregate address testing

4 weeks agoMerge pull request #18503 from gromit1811/bugfix/ospf6_gr_leak
Donald Sharp [Wed, 26 Mar 2025 14:30:30 +0000 (10:30 -0400)]
Merge pull request #18503 from gromit1811/bugfix/ospf6_gr_leak

ospf6d: Fix LSA memory leaks related to graceful restart

4 weeks agotests: Use label 0x800000 instead of 0x000000 for BMP tests
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>