Commit Graph

38290 Commits

Author SHA1 Message Date
Russ White
9a939d6ed6
Merge pull request #18198 from cscarpitta/feature/srv6_staticd_ua
staticd: Add support for SRv6 uA behavior
2025-02-26 09:52:08 -05:00
Christian Hopps
bce25cf43b tests: add oper test using existing libyang state tree
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-26 13:38:42 +00:00
Christian Hopps
656c4692a0 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>
2025-02-26 13:38:42 +00:00
Christian Hopps
bd68a01d9a lib: nb: notification add locking support for multi-threading
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-26 13:38:42 +00:00
Gabriel Goller
84d99ad8a6 fabricd: add option to treat dummy interfaces as loopback interfaces
Enable dummy-interfaces to be used as router-id interfaces in openfabric
networks. This allows multiple openfabric routers with different
router-ids on a single node when using IP unnumbered setup (interfaces
without IPs configured). Previously we were limited by having a single
loopback interface, allowing only one openfabric router per node.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2025-02-26 10:07:54 +01:00
Donatas Abraitis
1016090a8a
Merge pull request #18235 from donaldsharp/static_registering_unknown_vrf
staticd: Fix crash because registering unknown vrf
2025-02-26 09:00:59 +01:00
Carmine Scarpitta
35b40cc996 doc: Add SRv6 uA SID configuration to staticd documentation
This commit adds detailed explanation on configuring SRv6 uA SIDs.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:52 +01:00
Carmine Scarpitta
43c13777b2 tests: Add test case to verify the programming of SRv6 uA SIDs
This commit adds a test case to ensure staticd correctly programs SRv6
uA SIDs in the RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:52 +01:00
Carmine Scarpitta
062fd00ad6 staticd: Extend SRv6 SIDs show CLI to display uA SIDs
This commit extends the SRv6 SIDs show CLI to display the configured
SRv6 uA SIDs.

```
segment-routing
 srv6
  static-sids
   sid fcbb:bbbb:1:fe40::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2
  !
 !
!
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:52 +01:00
Carmine Scarpitta
f2fcdaad3a staticd: Extend CLI to unconfigure an SRv6 uA SID
This commit extends the STATIC CLI to support the deletion of uA SIDs.

```
router(config)# no sid fcbb:bbbb:1:fe00::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:52 +01:00
Carmine Scarpitta
70c039baa8 staticd: Extend CLI to configure an SRv6 uA SID
This commit extends the STATIC CLI to support the configuration of uA
SIDs.

```
router(config)# sid fcbb:bbbb:1:fe00::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:52 +01:00
Carmine Scarpitta
95abf9d678 staticd: Extend static_zebra_srv6_sid_uninstall to uninstall SRv6 uA SIDs
This commit extends the `static_zebra_srv6_sid_uninstall` function to
allow staticd to remove SRv6 uA SIDs from the zebra RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:52 +01:00
Carmine Scarpitta
ae6fb9196a staticd: Extend static_zebra_srv6_sid_install to install SRv6 uA SIDs
This commit extends the `static_zebra_srv6_sid_install` function to
allow staticd to install SRv6 uA SIDs into the zebra RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:52 +01:00
Carmine Scarpitta
cc84e52281 staticd: Extend static_zebra_release_srv6_sid to release SRv6 uA SIDs
When removing an SRv6 uA SID, staticd should ask SRv6 SID Manager to
release the SID.
Currently, `static_zebra_release_srv6_sid` does not allow to release uA
SIDs.

This commit extends `static_zebra_release_srv6_sid` to allow staticd to
release SRv6 uA SIDs.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:51 +01:00
Carmine Scarpitta
ec5ff367b1 staticd: Extend static_zebra_request_srv6_sid to request SRv6 uA SIDs
In order to configure an SRv6 uA SID in staticd, staticd should request
SRv6 SID Manager to allocate a SID bound to the uA behavior.
Currently, `static_zebra_request_srv6_sid` does not support requesting
SIDs bound to the uA behavior.

This commit extends the `static_zebra_request_srv6_sid` function to
enable staticd to request SIDs bound to the uA behavior.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:51 +01:00
Carmine Scarpitta
646c4f95d9 staticd: Add nb callbacks to configure a nexthop for SRv6 uA behavior
An SRv6 uA SID is associated with the interface and (optionally) the
IPv6 address of the nexthop.

This commit adds the modify and destroy nortbound callbacks required to
set the nexthop.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:51 +01:00
Carmine Scarpitta
7438a94eeb staticd: Add nb callbacks to configure an interface for SRv6 uA behavior
An SRv6 uA SID is associated with the interface and (optionally) the
IPv6 address of the nexthop.

This commit adds the modify and destroy nortbound callbacks required to
set the interface.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:51 +01:00
Carmine Scarpitta
99742410bf yang: Extend staticd YANG model to support the SRv6 uA behavior
The SRv6 uA behavior is associated with a L3 adjacency.

This commit extends the staticd YANG model by adding two leafs
`interface` and `next-hop` under the `static-sids` container. This
extension allows us to associate an interface and a nexthop when
configuring an SRv6 uA SID.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:51 +01:00
Carmine Scarpitta
feff426771 lib: Add ifindex to SRv6 SID context
The uA behavior is associated with an interface and the IP address of
the nexthop. However, the current SID context data structure only
includes the IP address. It lacks the interface.

This commit extends the SID context data structure by adding the
ifindex. This extension allows daemons to allocate uA SIDs with
the required interface and IP address.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:51 +01:00
Y Bharath
6aaffc7c37 tests: Fixed input dict at create_router_bgp
Missing comma between the key-value pairs

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-02-25 21:35:47 +05:30
Russ White
77b52da131
Merge pull request #18256 from Shbinging/fix_no_ip_split-horizon_poisoned-reverse
ripd: fix no ip rip split-horizon poisoned-reverse command
2025-02-25 10:45:55 -05:00
Russ White
8d48f1450e
Merge pull request #18119 from louis-6wind/bgp-hidden
bgpd: fix default instance when leaving the hidden state.
2025-02-25 09:59:11 -05:00
Mark Stapp
739020c71c
Merge pull request #18243 from dksharp5/remove_everything
Drop unused code
2025-02-25 09:43:00 -05:00
Gabriel Goller
80e96712e4 zebra: add ZEBRA_IF_DUMMY flag for dummy interfaces
Introduce ZEBRA_IF_DUMMY interface flag to identify Linux dummy interfaces [0].
These interfaces behave similarly to loopback interfaces and can be
specially handled by daemons.

[0]: https://github.com/torvalds/linux/blob/master/drivers/net/dummy.c

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2025-02-25 10:13:34 +01:00
Shbinging
22bec0df47 ripd: fix no ip rip split-horizon poisoned-reverse command
`no ip rip split-horizon poisoned-reverse` will undo poisoned-reverse and set default behavior which is split-horizon.
By contrast, `no ip rip split-horizon` will undo interface's split-horizon behavior.

Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2025-02-25 16:07:49 +08:00
Acee Lindem
06af50eace ospf6d: Fix use after free of router in OSPFv3 ABR route calculation.
This PR fixes FRR issue https://github.com/FRRouting/frr/issues/18040. The
OSPFv3 route is locked during the ABR calculation since there are
scenarios under which it is freed. The OSPFv3 ABR computation is
sub-optimal and this PR doesn't attempt to rework it.

Signed-off-by: Acee Lindem <acee@lindem.com>
2025-02-24 21:54:10 +00:00
Donna Sharp
e0387cd17f zebra: use provider function to receive data directly
Signed-off-by: Donna Sharp <dksharp5@gmail.com>
2025-02-24 14:51:12 -05:00
Donna Sharp
e7d61aa797 ospfd: remove unused function ins ospfd/ospf_lsa.c
Signed-off-by: Donna Sharp <dksharp5@gmail.com>
2025-02-24 14:40:22 -05:00
Jafar Al-Gharaibeh
f35de3f8cb
Merge pull request #18216 from gromit1811/bugfix_pim_vrf_register
pimd: Fix PIM VRF support (send register/register stop in VRF)
2025-02-24 12:56:08 -06:00
Donald Sharp
777aae08cf
Merge pull request #18226 from nabahr/pim-vrf-bind
pim: Fix vrf binding of autorp and mroute socket
2025-02-24 13:53:39 -05:00
Donald Sharp
231110aefd
Merge pull request #18225 from nabahr/autorp-joins
pim: Fix autorp group joins
2025-02-24 13:53:21 -05:00
Christian Hopps
311bd23ccb
Merge pull request #18236 from donaldsharp/zebra_multipath_num_operational_data
zebra: Add operational retrieval of Multipath Number
2025-02-24 12:33:34 -05:00
Louis Scalbert
077a2b0dfc tests: check as number in show run
Creates the default VRF instance after the other VRF instances. The
default VRF instance is created in hidden state. Check that AS number
in show run is correctly written.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 17:52:44 +01:00
Louis Scalbert
70e07678bf bgpd: fix leaving hidden state
Upon configuration of a VRF instance that references an absent default
VRF with "import vrf default", the default instance is created in hidden
state. However, the default instance is not properly un-hidden when
configured.

Restore the behavior prior to commit below.

Fixes: 9f7177af13 ("bgpd: fix duplicate BGP instance created with unified config")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 17:52:43 +01:00
Louis Scalbert
118afe4690 tests: add bgp_l3vpn_hidden topotest
Test that leaving the hidden BGP instance state is working.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 17:52:43 +01:00
Alexander Skorichenko
1515a59202 bgpd: update AS value of a hidden bgp instance
'import vrf VRF' could define a hidden bgp instance with
the default AS_UNSPECIFIED (i.e. = 1) value.
When a
	router bgp AS vrf VRF
gets configured later on, replace this AS_UNSPECIFIED setting
with a requested value.

Fixes: 9680831518 ("bgpd: fix as_pretty mem leaks when un-hiding")
Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 15:17:05 +01:00
Louis Scalbert
339206341f Revert "bgpd: fix bgp vrf instance creation from implicit"
This reverts commit 2ff08af78e.

The fix is obviously wrong.

Link: 2ff08af78e
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 15:17:05 +01:00
Louis Scalbert
71a3756f2d bgpd: fix process_queue when un-hiding
bgp_process_queue_init() is not called in bgp_create() when leaving the
BGP instance hidden state because of the following goto:

>	if (hidden) {
>		bgp = bgp_old;
>		goto peer_init;
>	}

Upon reconfiguration of the default instance, the prefixes are never set
into a meta queue by mq_add_handler(). They are never processed for
zebra RIB installation and announcements of update/withdraw.

Do not delete the BGP process_queue when hiding.

Fixes: 4d0e7a49cf ("bgpd: VRF-Lite fix default bgp delete")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 15:17:05 +01:00
Louis Scalbert
d2ff7e8a21 bgpd: fix default instance name when un-hiding
When unconfiguring a default BGP instance with VPN SAFI configurations,
the default BGP structure remains but enters a hidden state. Upon
reconfiguration, the instance name incorrectly appears as "VIEW ?"
instead of "VRF default". And the name_pretty pointer

The name_pretty pointer is replaced by another one with the incorrect
name. This also leads to a memory leak as the previous pointer is not
properly freed.

Do not rewrite the instance name.

Fixes: 4d0e7a49cf ("bgpd: VRF-Lite fix default bgp delete")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 15:17:05 +01:00
Christian Hopps
915dcd220d lib: northbound: support pre-built oper state in libyang tree
This also fixes a bug with specific (position specified) queries on keyless
lists. If the `get_next` callback is using the parent entry it will probably
crash as the code is passing the list_entry as both parent and child in the
specific lookup case.

There may currently be no code that uses the parent entry if the child entry is
non-NULL, though.

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-24 04:09:17 +00:00
Donald Sharp
03ebdc3c4a zebra: Add operational retrieval of Multipath Number
The multipath number specified is not available through
the yang data and is not retrievable.  Make it so.
At this point in time do not allow this to be set from
yang.  Perhaps in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-23 11:14:47 -05:00
Donald Sharp
da0f552f5d staticd: Fix crash because registering unknown vrf
With recent commit:

c1adc8f1d6 staticd has started to crash
aproximately 1/10 of the tine in the static_vrf topotest

(gdb) bt
0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:44
1  __pthread_kill_internal (signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:78
2  __GI___pthread_kill (threadid=140400982256064, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
3  0x00007fb1a6442476 in __GI_raise (sig=6) at ../sysdeps/posix/raise.c:26
4  0x00007fb1a6950823 in core_handler (signo=6, siginfo=0x7ffd6d832ff0, context=0x7ffd6d832ec0) at lib/sigevent.c:268
5  <signal handler called>
6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:44
7  __pthread_kill_internal (signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:78
8  __GI___pthread_kill (threadid=140400982256064, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
9  0x00007fb1a6442476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
10 0x00007fb1a64287f3 in __GI_abort () at ./stdlib/abort.c:79
11 0x00007fb1a699a422 in _zlog_assert_failed (xref=0x55f7dfd3dac0 <_xref.117>,
   extra=0x55f7dfd30c30 "BUG: NH %pFX registered but not in hashtable") at lib/zlog.c:789
12 0x000055f7dfd1201f in static_zebra_nht_register (nh=0x55f7fd2ecd80, reg=true) at staticd/static_zebra.c:333
13 0x000055f7dfd29c9d in static_install_nexthop (nh=0x55f7fd2ecd80) at staticd/static_routes.c:299
14 0x000055f7dfd2a126 in static_fixup_vrf (vrf=0x55f7fd2333a0, stable=0x55f7fd271030, afi=AFI_IP, safi=SAFI_UNICAST)
   at staticd/static_routes.c:441
15 0x000055f7dfd2a2be in static_fixup_vrf_ids (vrf=0x55f7fd2333a0) at staticd/static_routes.c:494
16 0x000055f7dfd15b53 in static_vrf_enable (vrf=0x55f7fd2333a0) at staticd/static_vrf.c:124
17 0x00007fb1a696ffa5 in vrf_enable (vrf=0x55f7fd2333a0) at lib/vrf.c:325
18 0x00007fb1a6991c87 in zclient_vrf_add (cmd=33, zclient=0x55f7fd29f740, length=76, vrf_id=8) at lib/zclient.c:2701
19 0x00007fb1a6996cba in zclient_read (thread=0x7ffd6d834230) at lib/zclient.c:4764
20 0x00007fb1a696bd9b in event_call (thread=0x7ffd6d834230) at lib/event.c:2019
21 0x00007fb1a68e1a3a in frr_run (master=0x55f7fd102e10) at lib/libfrr.c:1246
22 0x000055f7dfd1081e in main (argc=7, argv=0x7ffd6d834478, envp=0x7ffd6d8344b8) at staticd/static_main.c:193

Tracking this down, the crash is because the nh believes that is already
registered but lookup fails, causing this assert.  Looking at the code
static_fixup_vrf is changing the vrf_id.  I put a zlog_debug right
before the change of the nh vrf_id and noticed that the vrf id was
UNKNOWN.  So, the code is attempting to register into zebra the nexthop
with a vrf unknown( which will be ignored ).

Modify the code in the registration process to notice that the nh is
still UNKNOWN and as such nothing should be done.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-22 18:13:15 -05:00
Jafar Al-Gharaibeh
3f290c97e8
Merge pull request #18231 from LabNConsulting/chopps/fix-case-choice-queries
Fix oper-state queries that involve choice/case nodes
2025-02-22 14:06:37 -06:00
Christian Hopps
73df7da40a tests: add unit-test for choice/case node queries
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-22 16:25:31 +00:00
Christian Hopps
b9ff10b086 lib: nb: fix oper-state queries that involve choice/case nodes
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-22 16:25:31 +00:00
Jafar Al-Gharaibeh
67985ba8ec
Merge pull request #18210 from donaldsharp/fix_bestpath_evpn_issue
bgpd: remove dmed check not required in bestpath selection
2025-02-21 17:11:13 -06:00
Jafar Al-Gharaibeh
7719645c69
Merge pull request #18224 from LabNConsulting/chopps/fe-client-docstrings
tests: add docstrings to frontend mgmtd client
2025-02-21 17:07:26 -06:00
Jafar Al-Gharaibeh
aa4bd0839f
Merge pull request #18223 from LabNConsulting/chopps/doc-mgmt-update
doc: update mgmtd list of converted
2025-02-21 17:07:02 -06:00
Nathan Bahr
d840560b74 pim: Fix autorp group joins
Group joining got broken when moving the autorp socket to open/close
as needed. This fixes it so autorp group joining is properly handled
as part of opening the socket.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-02-21 21:38:32 +00:00
Nathan Bahr
7e181a771c pim: Fix vrf binding of autorp and mroute socket
Bind the autorp socket to the vrf device.
Also fixed mroute socket to use vrf_bind instead of directly
setting the socket option.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-02-21 19:32:40 +00:00