Commit graph

38811 commits

Author SHA1 Message Date
Loïc Sang e65d12f4e5 pimd: add YANG attr to YANG cmd
Those commands are using northbound api, add YANG attr to them. This
will allow them to use with pending commit, else the validation will
failed as they are detected as non YANG cmd.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
2025-04-08 17:05:52 +02:00
Loïc Sang de5eaf322b pathd: add YANG attr to YANG cmd
Those commands are using northbound api, add YANG attr to them. This
will allow them to use with pending commit, else the validation will
failed as they are detected as non YANG cmd.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
2025-04-08 16:58:37 +02:00
Russ White e9e9b2ba7e
Merge pull request #18585 from zmw12306/babel-knownae
babel: fix incorrect check in known_ae()
2025-04-08 10:55:24 -04:00
Russ White 9f59a2d05c
Merge pull request #18584 from zmw12306/babel_get_myid
babeld: Add a check to prevent all-ones case
2025-04-08 10:54:50 -04:00
Russ White 53a8868331
Merge pull request #18582 from zmw12306/route_lost
babeld: Fix starvation handling on route loss per RFC 8966 §3.8.2.1
2025-04-08 10:52:39 -04:00
Russ White 59b62ca788
Merge pull request #18581 from zmw12306/request_forward
babeld: Request forwarding does not prioritize feasible routes
2025-04-08 10:52:08 -04:00
Russ White 28d66ef7f1
Merge pull request #18547 from zmw12306/Hop-Count
babeld: Hop Count must not be 0.
2025-04-08 10:31:01 -04:00
Philippe Guibert 2ced6d233f bgpd: add usid behavior for bgp srv6 instructions
Until now, BGP srv6 usid instructions were not really used. Add the
support for this.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-04-08 16:16:06 +02:00
Loïc Sang 731e438b22 isisd: add YANG attr to YANG cmd
Those commands are using northbound api, add YANG attr to them. This
will allow them to use with pending commit, else the validation will
failed as they are detected as non YANG cmd.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
2025-04-08 15:24:41 +02:00
Carmine Scarpitta 46a526568f
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
2025-04-08 14:53:26 +02:00
Y Bharath 8c2e01e245 yang: Pyang errors in frr-bfdd.yang
Corrected pyang errors in frr-bfdd.yang

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-04-08 14:27:28 +05:30
Christian Hopps 3f6be74025 doc: add a diagram for config datastore cleanup on file reads
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-04-08 07:04:19 +00:00
Christian Hopps b12b4c28b4 mgmtd: remove bogus "hedge" code which corrupted active candidate DS
Say you have 2 mgmtd frontend sessions (2 vtysh's) the first one is long
running and is actively changing the global candidate datastore (DS),
the second one starts and exits, this code would then copy running
back over the candidate, blowing away any changes made by the first
session.

(the long running session could technically be any user)

Instead we need to trust the various cleanup code that already exits.
For example in the commit_cfg_reply on success candidate is copied to
running, and on failure *for implicit commit* running is copied back to
candidate clearing the change. This leaves the non-implicit
configuration changes in this case we actually want candidate to keep
it's changes in transactional cases, in the other case of pending commit
during a file read the code restores candidate (if needed) on exit from
"config terminal", with this call stack:

 vty_config_node_exit()
   nb_cli_pending_commit_check()
     nb_cli_classic_commit()
       nb_candidate_commit_prepare() [fail] -> copy running -> candidate
       nb_candidate_commit_apply() -> copy candidate -> running

fixes #18541

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-04-08 05:39:18 +00:00
zmw12306 7c87716482 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>
2025-04-07 16:13:45 -04:00
Rajasekar Raja dbd9fed0b3 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>
2025-04-07 10:34:07 -07:00
Donatas Abraitis 5e092d0e25
Merge pull request #18558 from spoignant-proton/master
bgpd: flowspec: remove sizelimit check applied to the wrong length field (issue 18557)
2025-04-07 03:27:02 +03:00
zmw12306 b70f973834 bfdd: Set bfd.LocalDiag when transitioning to AdminDown
RFC 5880 6.8.16, need to set LocalDiag when transitioning to AdminDown state.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
2025-04-06 16:13:32 -04:00
zmw12306 b2ab620121 bfdd: Fix demultiplexing to rely solely on Your Discriminator as per RFC 5880.
According to RFC 5880 Section 6.3, once the remote peer reflects back the local discriminator, the receiver MUST demultiplex subsequent BFD packets based solely on the Your Discriminator field. The source IP or interface MUST NOT be used in demultiplexing once the session is established.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
2025-04-05 19:02:31 -04:00
zmw12306 16a0458dbc 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>
2025-04-05 15:24:06 -04:00
zmw12306 e43dbc8fe1 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>
2025-04-05 15:21:27 -04:00
zmw12306 6f88868f32 babeld: check valid babel port
Add checking for port == 6696.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
2025-04-05 15:14:12 -04:00
zmw12306 8a8c43c891 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>
2025-04-05 14:26:32 -04:00
zmw12306 49f6e9a385 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>
2025-04-05 14:00:41 -04:00
Mark Stapp 259ffe1dfe
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
2025-04-04 12:28:18 -04:00
Stephane Poignant 2cee5567bc
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>
2025-04-04 13:29:02 +02:00
Y Bharath 920ef44023 tests: Shadowing the built-in function
Shadowing the built-in function

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-04-04 12:25:18 +05:30
Donatas Abraitis 03c5ada020
Merge pull request #18567 from nabahr/proxy_init_disable
pimd: Initialize gm proxy to false
2025-04-04 02:10:35 +03:00
Mark Stapp bee5b36bbb
Merge pull request #18572 from opensourcerouting/fix/syntax_error_bgp_gr_notification
tests: Fix typo when configuring delayopen timer
2025-04-03 10:32:05 -04:00
Mark Stapp e0a97e5b85
Merge pull request #18546 from LabNConsulting/ziemba/250330-rfapi-mem-cleanup
bgpd: rfapi: track outstanding rib and import timers, free mem at exit
2025-04-03 09:01:35 -04:00
Russ White ab67e5544e
Merge pull request #18396 from pguibert6WIND/srv6l3vpn_to_bgp_vrf_redistribute
Add BGP redistribution in SRv6 BGP
2025-04-03 08:25:32 -04:00
Donatas Abraitis 55d88ee3de tests: Fix typo when configuring delayopen timer
`"` was accidentally added, and random tests failures happening.

Fixes: a4f61b78dd ("tests: Check if routes are marked as stale and retained with N-bit for GR")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-04-03 14:01:20 +03:00
Donatas Abraitis 112663772a
Merge pull request #18553 from y-bharath14/srib-tests-v9
tests: Resource leaks in test_all_protocol_startup
2025-04-03 11:08:37 +03:00
Donatas Abraitis b977a0541c
Merge pull request #18564 from routingrocks/rvaratharaj/bug_fix_bgp
bgpd: Skip EVPN MAC processing for non-EVPN peers
2025-04-03 09:46:34 +03:00
Nathan Bahr 153d9ea3b9 pimd: Initialize gm proxy to false
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-04-02 21:07:41 +00:00
Jafar Al-Gharaibeh 994fdeeb22
Merge pull request #18525 from donaldsharp/eigrp_coverity_newly_found
eigrpd: Fix possible use after free in nbr deletion
2025-04-02 14:13:37 -05:00
Jafar Al-Gharaibeh d9a00d25d9
Merge pull request #18561 from opensourcerouting/fix/ipv6_duplicate_check
lib: Return duplicate ipv6 prefix-list entry test
2025-04-02 14:08:12 -05:00
Rajesh Varatharaj 35129c88b4 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>
2025-04-02 11:48:42 -07:00
Donatas Abraitis da4a7b0356 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>
2025-04-02 17:24:09 +03:00
Russ White d10b08e4e8
Merge pull request #18097 from louis-6wind/attrhash_cmp
bgpd: optimize attrhash_cmp calls
2025-04-02 08:25:35 -04:00
Donatas Abraitis 24ae7cd30a lib: Return duplicate ipv6 prefix-list entry test
Fixes: 8384d41144 ("lib: Return duplicate prefix-list entry test")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-04-02 11:09:59 +03:00
Russ White 90b004cd46
Merge pull request #18543 from y-bharath14/srib-yang-v8
yang: Corrected pyang errors in frr-zebra.yang
2025-04-01 17:30:30 -04:00
Christopher Dziomba 069a23da10
zebra: Add refcounts to evpn nexthop prefixes
With bgpd no longer sending withdraws for EVPN prefix routes
zebra needs to track the path/ref count of prefixes for an EVPN
nexthop. When a route is updated the count is first increased
with the new paths and then decreased with the paths of the
existing/"same" route entry.
However the same evpn route methods are used for EVPN MH as well,
where bgpd already tracks the references. It is expected that an
ADD operation for the respective A-D routes is handled as an
upsert, a DEL operation should really remove the respective A-D
reference on a next-hop. For this the old behaviour (no path/ref
counting in zebra) is preserved.

Signed-off-by: Christopher Dziomba <christopher.dziomba@telekom.de>
2025-04-01 20:32:50 +02:00
Christopher Dziomba 068a00f11e
bgpd: Do not withdraw EVPN route to update
Previously bgpd needed to send a withdraw followed by an install
to update an EVPN prefix route. With refcount tracking in zebra
this is no longer needed

Signed-off-by: Christopher Dziomba <christopher.dziomba@telekom.de>
2025-04-01 20:32:48 +02:00
Louis Scalbert cbf27be5d9 bgpd: optimize attrhash_cmp calls
Only call attrhash_cmp when necessary.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-04-01 16:52:58 +02:00
Russ White 9f8027b8a4
Merge pull request #18524 from donaldsharp/eigrp_limit_asn_vrf
yang: Limit eigrp to just 1 instance per vrf
2025-04-01 10:22:21 -04:00
Russ White ec1fcc1799
Merge pull request #18470 from zmw12306/NH_Init
babeld: Add next hop initialization
2025-04-01 10:13:11 -04:00
Russ White c312917988
Merge pull request #18450 from donaldsharp/bgp_packet_reads
Bgp packet reads conversion to a FIFO
2025-04-01 10:12:37 -04:00
Krishnasamy 751ae76648 zebra: show command to display metaq info
Display below info from metaq and sub queues
1. Current queue size
2. Max/Highwater size
3. Total number of events received fo so far

r1# sh zebra metaq
MetaQ Summary
Current Size    : 0
Max Size        : 9
Total           : 20
 |------------------------------------------------------------------|
 | SubQ                             | Current  | Max Size  | Total  |
 |----------------------------------+----------+-----------+--------|
 | NHG Objects                      | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | EVPN/VxLan Objects               | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Early Route Processing           | 0        | 8         | 11     |
 |----------------------------------+----------+-----------+--------|
 | Early Label Handling             | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Connected Routes                 | 0        | 6         | 9      |
 |----------------------------------+----------+-----------+--------|
 | Kernel Routes                    | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Static Routes                    | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | RIP/OSPF/ISIS/EIGRP/NHRP Routes  | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | BGP Routes                       | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Other Routes                     | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Graceful Restart                 | 0        | 0         | 0      |
 |------------------------------------------------------------------|

Signed-off-by: Krishnasamy <krishnasamyr@nvidia.com>
2025-04-01 09:32:46 +00:00
Y Bharath 09081f8563 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>
2025-04-01 12:06:15 +05:30
G. Paul Ziemba 1629c05924 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>
2025-03-31 08:45:33 -07:00