]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
2 months agostaticd: Failed to register nexthop after networking restart 18164/head
Pooja Jagadeesh Doijode [Fri, 14 Feb 2025 07:34:46 +0000 (23:34 -0800)]
staticd: Failed to register nexthop after networking restart

Problem:
After networking restart, staticd unregistered the nexthop
but failed to register the nexthop again, which caused the
nexthop to remain inactive in zebra for static route.

Fix:
Call to static_zebra_nht_register() from static_install_path() was
removed in 3c05d53bf8defc36acdfe6e78064e068d60c649f. Adding it back
so that staticd can register the nexthop for static routes.

Testing:
After networking restart trigger on h1:

Before fix:
```
h1# show ipv6 route vrf vrf1012
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIPng, O - OSPFv3, I - IS-IS, B - BGP, N - NHRP,
       T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
       t - Table-Direct, Z - FRR,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF vrf1012:
S   ::/0 [1/0] via 2003:7:2::1, swp1.2 inactive, weight 1, 00:00:39
K>* ::/0 [255/8192] unreachable (ICMP unreachable) (vrf default), 00:00:39
L * 2000:9:12::3/128 is directly connected, vrf1012, 00:00:39
C>* 2000:9:12::3/128 is directly connected, vrf1012, 00:00:39
C>* 2003:7:2::/125 is directly connected, swp1.2, 00:00:37
L>* 2003:7:2::3/128 is directly connected, swp1.2, 00:00:37
C>* fe80::/64 is directly connected, swp1.2, 00:00:37
h1#
```

After fix:
```
h1# show ipv6 route vrf vrf1012

Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIPng, O - OSPFv3, I - IS-IS, B - BGP, N - NHRP,
       T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
       t - Table-Direct, Z - FRR,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF vrf1012:
S>* ::/0 [1/0] via 2003:7:2::1, swp1.2, weight 1, 00:00:15
K * ::/0 [255/8192] unreachable (ICMP unreachable) (vrf default), 00:00:17
L * 2000:9:12::3/128 is directly connected, vrf1012, 00:00:17
C>* 2000:9:12::3/128 is directly connected, vrf1012, 00:00:17
C>* 2003:7:2::/125 is directly connected, swp1.2, 00:00:15
L>* 2003:7:2::3/128 is directly connected, swp1.2, 00:00:15
```

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2 months agoMerge pull request #18120 from louis-6wind/fix-bgp-rd-json-show
Donatas Abraitis [Wed, 12 Feb 2025 20:09:39 +0000 (22:09 +0200)]
Merge pull request #18120 from louis-6wind/fix-bgp-rd-json-show

bgpd: fix incorrect JSON in bgp_show_table_rd

2 months agoMerge pull request #18118 from y-bharath14/srib-yang-v1
Christian Hopps [Wed, 12 Feb 2025 19:46:59 +0000 (14:46 -0500)]
Merge pull request #18118 from y-bharath14/srib-yang-v1

yang: Reorder the revision statements

2 months agoMerge pull request #18125 from donaldsharp/bfd_fd_zero
Mark Stapp [Wed, 12 Feb 2025 19:21:42 +0000 (14:21 -0500)]
Merge pull request #18125 from donaldsharp/bfd_fd_zero

bfdd: 0 is a valid fd.

2 months agoMerge pull request #17649 from ariel-anieli/calloc-warns
Donald Sharp [Wed, 12 Feb 2025 18:00:36 +0000 (13:00 -0500)]
Merge pull request #17649 from ariel-anieli/calloc-warns

tests: clear `-Wcalloc-transposed-args` warnings

2 months agoMerge pull request #18026 from donaldsharp/bfd_fixups
Jafar Al-Gharaibeh [Wed, 12 Feb 2025 18:00:23 +0000 (12:00 -0600)]
Merge pull request #18026 from donaldsharp/bfd_fixups

Bfd fixups

2 months agobfdd: 0 is a valid fd. 18125/head
Donald Sharp [Wed, 12 Feb 2025 15:33:22 +0000 (10:33 -0500)]
bfdd: 0 is a valid fd.

It's unlikely that this would ever get a 0 fd to use
but let's just let the code assume it is ok.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #18062 from pguibert6WIND/cid_1636504
Donald Sharp [Wed, 12 Feb 2025 14:36:21 +0000 (09:36 -0500)]
Merge pull request #18062 from pguibert6WIND/cid_1636504

Cid 1636504

2 months agoMerge pull request #18068 from opensourcerouting/fix/coverity_link_local_capability
Donald Sharp [Wed, 12 Feb 2025 14:35:16 +0000 (09:35 -0500)]
Merge pull request #18068 from opensourcerouting/fix/coverity_link_local_capability

bgpd: Do not check for capability length for Link-Local Next Hop capability

2 months agoMerge pull request #18094 from opensourcerouting/event-tardy-bfd
Donald Sharp [Wed, 12 Feb 2025 14:29:54 +0000 (09:29 -0500)]
Merge pull request #18094 from opensourcerouting/event-tardy-bfd

lib (+bfd): improve late timer warnings

2 months agoMerge pull request #18049 from donaldsharp/fpm_keep_on_trying
Mark Stapp [Wed, 12 Feb 2025 13:47:02 +0000 (08:47 -0500)]
Merge pull request #18049 from donaldsharp/fpm_keep_on_trying

zebra: Allow fpm_listener to continue to try to read

2 months agobgpd: fix incorrect json in bgp_show_table_rd 18120/head
Louis Scalbert [Wed, 12 Feb 2025 11:50:42 +0000 (12:50 +0100)]
bgpd: fix incorrect json in bgp_show_table_rd

In bgp_show_table_rd(), the is_last argument is determined using the
expression "next == NULL" to check if the RD table is the last one. This
helps ensure proper JSON formatting.

However, if next is not NULL but is no longer associated with a BGP
table, the JSON output becomes malformed.

Updates the condition to also verify the existence of the next bgp_dest
table.

Fixes: 1ae44dfcba ("bgpd: unify 'show bgp' with RD with normal unicast bgp show")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agoyang: Reorder the revision statements 18118/head
Y Bharath [Wed, 12 Feb 2025 06:43:06 +0000 (12:13 +0530)]
yang: Reorder the revision statements

According to the YANG specification, the revision statements should be
ordered with the most recent revision first

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2 months agoMerge pull request #18069 from cscarpitta/fix/bgp_request_srv6_locator
Jafar Al-Gharaibeh [Wed, 12 Feb 2025 02:59:22 +0000 (20:59 -0600)]
Merge pull request #18069 from cscarpitta/fix/bgp_request_srv6_locator

bgpd: Request SRv6 locator after zebra connection

2 months agoMerge pull request #18078 from pguibert6WIND/nhrp_incomplete_msg
Jafar Al-Gharaibeh [Wed, 12 Feb 2025 02:57:09 +0000 (20:57 -0600)]
Merge pull request #18078 from pguibert6WIND/nhrp_incomplete_msg

nhrpd: fix dont consider incomplete L2 entry

2 months agoMerge pull request #18037 from pguibert6WIND/bmp_bgp_open_router_id_and_as_val
Russ White [Tue, 11 Feb 2025 18:43:09 +0000 (13:43 -0500)]
Merge pull request #18037 from pguibert6WIND/bmp_bgp_open_router_id_and_as_val

Bmp bgp open router id and as val

2 months agozebra: Allow fpm_listener to continue to try to read 18049/head
Donald Sharp [Thu, 6 Feb 2025 23:40:30 +0000 (18:40 -0500)]
zebra: Allow fpm_listener to continue to try to read

Currently when the fpm_listener attempts to read say X
bytes it may only get Y( which is less than X ).  In this
case we should assume that the dplane_fpm_nl code is just
being slow, as that we know it is possible for it to send
a partial fpm message.  Let's just loosen the constraints
a bit and allow data to flow.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #18060 from opensourcerouting/lib-crashlog-signals
Donald Sharp [Tue, 11 Feb 2025 17:25:28 +0000 (12:25 -0500)]
Merge pull request #18060 from opensourcerouting/lib-crashlog-signals

lib: crash handlers must be allowed on threads

2 months agoMerge pull request #18081 from chiragshah6/bgp_dev6
Russ White [Tue, 11 Feb 2025 17:19:45 +0000 (12:19 -0500)]
Merge pull request #18081 from chiragshah6/bgp_dev6

bgpd: fix bgp vrf instance creation from implicit

2 months agoMerge pull request #18034 from donaldsharp/unneeded_isisd
Russ White [Tue, 11 Feb 2025 13:50:09 +0000 (08:50 -0500)]
Merge pull request #18034 from donaldsharp/unneeded_isisd

isisd: Remove unneeded modify functions

2 months agoMerge pull request #17870 from opensourcerouting/fix/bgp_show_ip_bgp_cmd_internal
Russ White [Tue, 11 Feb 2025 13:44:43 +0000 (08:44 -0500)]
Merge pull request #17870 from opensourcerouting/fix/bgp_show_ip_bgp_cmd_internal

bgpd: Show internal data for BGP routes

2 months agoMerge pull request #17370 from louis-6wind/fix-vpn-leaking
Russ White [Tue, 11 Feb 2025 13:41:03 +0000 (08:41 -0500)]
Merge pull request #17370 from louis-6wind/fix-vpn-leaking

bgpd: fix for the validity and the presence of prefixes in the BGP VPN table.

2 months agolib: `thread` -> `event` in formatting 18094/head
David Lamparter [Tue, 11 Feb 2025 10:58:15 +0000 (11:58 +0100)]
lib: `thread` -> `event` in formatting

Make it consistent and call it `event` when formatting something to
display.  Much less confusing for some user seeing it too, since threads
aren't involved.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agobfdd: use lower lateness warning for TX timers
David Lamparter [Tue, 11 Feb 2025 11:07:00 +0000 (12:07 +0100)]
bfdd: use lower lateness warning for TX timers

FRR's event loop prints a warning if a timer is executed more than some
given threshold late, default being 4s.  Set a more appropriate
threshold for BFD TX timers (half TX interval).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agolib: improve late timer warnings
David Lamparter [Tue, 11 Feb 2025 10:55:19 +0000 (11:55 +0100)]
lib: improve late timer warnings

Refactor the "timer getting executed too late" warning:

- warning threshold is now adjustable
- check is performed when event actually executes, rather than when it's
  thrown on ready list
- ignore_late_timer replaced with threshold = 0
- system load averages printed in log message
- warning ratelimited to once per 10s rather than once per poll()

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agonhrpd: fix dont consider incomplete L2 entry 18078/head
Philippe Guibert [Mon, 10 Feb 2025 15:15:44 +0000 (16:15 +0100)]
nhrpd: fix dont consider incomplete L2 entry

Sometimes, NHRP receives L2 information on a cache entry with the
0.0.0.0 IP address. NHRP considers it as valid and updates the binding
with the new IP address.

> Feb 09 20:09:54 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 162.251.180.10 nud 0x2 cache used 0 type 4
> Feb 09 20:10:35 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 162.251.180.10 nud 0x4 cache used 1 type 4
> Feb 09 20:10:48 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: del-neigh 10.2.114.238 dev dmvpn1 lladdr 162.251.180.10 nud 0x4 cache used 1 type 4
> Feb 09 20:10:49 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: who-has 10.2.114.238 dev dmvpn1 lladdr (unspec) nud 0x1 cache used 1 type 4
> Feb 09 20:10:49 aws-sin-vpn01 nhrpd[2695]: [QVXNM-NVHEQ] Netlink: update binding for 10.2.114.238 dev dmvpn1 from c 162.251.180.10 peer.vc.nbma 162.251.180.10 to lladdr (unspec)
> Feb 09 20:10:49 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 0.0.0.0 nud 0x2 cache used 1 type 4
> Feb 09 20:11:30 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 0.0.0.0 nud 0x4 cache used 1 type 4

Actually, the 0.0.0.0 IP addressed mentiones in the 'who-has' message is
wrong because the nud state value means that value is incomplete and
should not be handled as a valid entry. Instead of considering it, fix
this by by invalidating the current binding. This step is necessary in
order to permit NHRP to trigger resolution requests again.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agobgpd: fix bmp loc-rib peer up message should use correct AS number 18037/head
Philippe Guibert [Thu, 6 Feb 2025 10:32:46 +0000 (11:32 +0100)]
bgpd: fix bmp loc-rib peer up message should use correct AS number

The transmitted AS value in te tx open message of the peer up loc-rib
message is set to 0. Actually, it should reflect the AS value of the
current BGP instance.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agobgpd: fix loc-rib open message should use router-id
Philippe Guibert [Thu, 6 Feb 2025 10:26:42 +0000 (11:26 +0100)]
bgpd: fix loc-rib open message should use router-id

When forging BMP open message, the BGP router-id of tx open message of
the BMP LOC-RIB peer up message is always set to 0.0.0.0, whatever the
configured value of 'bgp router-id'.

Actually, when forging a peer up LOC-RIB message, the BGP router-id
value should be taken from the main BGP instance, and not from the peer
bgp identifier. Fix this by refreshing the router-id whenever a peer up
loc-rib message should be sent.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agobgpd: fix bgp label evpn CID 1636504 18062/head
Philippe Guibert [Fri, 7 Feb 2025 14:49:10 +0000 (15:49 +0100)]
bgpd: fix bgp label evpn CID 1636504

The following static analysis can be seen :

> *** CID 1636504:    (ARRAY_VS_SINGLETON)
> /bgpd/bgp_evpn_mh.c: 1241 in bgp_evpn_type1_route_process()
> 1235            build_evpn_type1_prefix(&p, eth_tag, &esi, vtep_ip);
> 1236            /* Process the route. */
> 1237            if (attr) {
> 1238                    bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi, safi, ZEBRA_ROUTE_BGP,
> 1239                               BGP_ROUTE_NORMAL, &prd, &label, num_labels, 0, NULL);
> 1240            } else {
> >>>     CID 1636504:    (ARRAY_VS_SINGLETON)
> >>>     Passing "&label" to function "bgp_withdraw" which uses it as an array. This might corrupt or misinterpret adjacent memory locations.
> 1241                    bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi, ZEBRA_ROUTE_BGP,
> 1242                                 BGP_ROUTE_NORMAL, &prd, &label, num_labels);
> 1243            }
> 1244            return 0;
> 1245     }
> 1246
> /bgpd/bgp_evpn_mh.c: 1238 in bgp_evpn_type1_route_process()
> 1232             * table
> 1233             */
> 1234            vtep_ip.s_addr = INADDR_ANY;
> 1235            build_evpn_type1_prefix(&p, eth_tag, &esi, vtep_ip);
> 1236            /* Process the route. */
> 1237            if (attr) {
> >>>     CID 1636504:    (ARRAY_VS_SINGLETON)
> >>>     Passing "&label" to function "bgp_update" which uses it as an array. This might corrupt or misinterpret adjacent memory locations.
> 1238                    bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi, safi, ZEBRA_ROUTE_BGP,
> 1239                               BGP_ROUTE_NORMAL, &prd, &label, num_labels, 0, NULL);
> 1240            } else {
> 1241                    bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi, ZEBRA_ROUTE_BGP,
> 1242                                 BGP_ROUTE_NORMAL, &prd, &label, num_labels);
> 1243            }

Fix this by declaring a label array instead of a single array.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agobgpd: simplify bgp_evpn_process_rt1 with label
Philippe Guibert [Fri, 7 Feb 2025 14:40:29 +0000 (15:40 +0100)]
bgpd: simplify bgp_evpn_process_rt1 with label

Remove the num_labels variable, the received bgp_update() and
bgp_withdraw() function will read the message as including one
label or vni value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agobgpd: fix bgp vrf instance creation from implicit 18081/head
Chirag Shah [Tue, 11 Feb 2025 02:56:15 +0000 (18:56 -0800)]
bgpd: fix bgp vrf instance creation from implicit

In bgp route leak, when import vrf x is executed,
it creates bgp instance as hidden with asn value as unspecified.

When router bgp x is configured ensure the correct as,
asnotation is applied otherwise running config shows asn value as 0.

This can lead to frr-reload failure when any FRR config change.

Fix:
Move asn and asnotiation, as_pretty value in common done section,
so when bgp_create gets existing instance but before returning
update asn and required fields in common section.

In bgp_create(): when returning for hidden at least update asn
and required when bgp instance created implicitly due to vrf leak.

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

Before fix:
show running:

router bgp 0 vrf purple
 bgp router-id 10.10.3.11
 !
 address-family ipv4 unicast
  redistribute static
  import vrf blue
 exit-address-family
 !
 address-family ipv6 unicast
  import vrf blue
 exit-address-family
 !
 address-family l2vpn evpn
  advertise ipv4 unicast
  advertise ipv6 unicast
 exit-address-family
exit

Testing:

1) following snippet config:
router bgp 63420 vrf blue
 import vrf purple
router bgp 63420 vrf purple
 import vrf blue
2) restart frr leads to the running config with 0 asn value.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 months agoMerge pull request #18077 from y-bharath14/srib-babeld-code-maintainability
Donald Sharp [Mon, 10 Feb 2025 14:48:23 +0000 (09:48 -0500)]
Merge pull request #18077 from y-bharath14/srib-babeld-code-maintainability

babeld: Improve code clarity and maintainability

2 months agoMerge pull request #17775 from gromit1811/pr_journald_bugfix
David Lamparter [Mon, 10 Feb 2025 08:27:50 +0000 (09:27 +0100)]
Merge pull request #17775 from gromit1811/pr_journald_bugfix

2 months agobabeld: Improve code clarity and maintainability 18077/head
Y Bharath [Mon, 10 Feb 2025 06:13:05 +0000 (11:43 +0530)]
babeld: Improve code clarity and maintainability

Improve code clarity and maintainability

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2 months agobgpd: Request SRv6 locator after zebra connection 18069/head
Carmine Scarpitta [Sat, 8 Feb 2025 23:44:01 +0000 (00:44 +0100)]
bgpd: Request SRv6 locator after zebra connection

When SRv6 is enabled and an SRv6 locator is specified in the BGP
configuration, BGP may attempt to request SRv6 locator information from
zebra before the connection is fully established. If this occurs, the
request fails with the following error:

```
2025/02/06 16:37:32 BGP: [HR66R-TWQYD][EC 100663302] srv6_manager_get_locator: invalid zclient socket
````

As a result, BGP is unable to obtain the locator information,
preventing SRv6 VPN from working.

This commit fixes the issue by ensuring BGP requests SRv6 locator
information once the connection with zebra is successfully established.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agobgpd: Do not check for capability length for Link-Local Next Hop capability 18068/head
Donatas Abraitis [Sat, 8 Feb 2025 11:01:01 +0000 (13:01 +0200)]
bgpd: Do not check for capability length for Link-Local Next Hop capability

Capability's length is 0 and this is not needed to check if it's multiplied by
X or there is a minimum length for that.

Fixes: db853cc97eafee8742cd391aaa2b5bc58a6751ae ("bgpd: Implement Link-Local Next Hop capability")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 months agoMerge pull request #17871 from opensourcerouting/feature/bgp_link_local_capability
Russ White [Fri, 7 Feb 2025 19:00:59 +0000 (14:00 -0500)]
Merge pull request #17871 from opensourcerouting/feature/bgp_link_local_capability

bgpd: Implement Link-Local Next Hop capability

2 months agoMerge pull request #18045 from LabNConsulting/ziemba/250205-rfapi-mem-cleanup
Donald Sharp [Fri, 7 Feb 2025 16:20:08 +0000 (11:20 -0500)]
Merge pull request #18045 from LabNConsulting/ziemba/250205-rfapi-mem-cleanup

bgpd: rfapi: fix mem leak when killed

2 months agolib: crash handlers must be allowed on threads 18060/head
David Lamparter [Fri, 7 Feb 2025 12:22:25 +0000 (13:22 +0100)]
lib: crash handlers must be allowed on threads

Blocking all signals on non-main threads is not the way to go, at least
the handlers for SIGSEGV, SIGBUS, SIGILL, SIGABRT and SIGFPE need to run
so we get backtraces.  Otherwise the process just exits.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agoMerge pull request #18048 from opensourcerouting/msdpt3f
Jafar Al-Gharaibeh [Fri, 7 Feb 2025 03:40:45 +0000 (21:40 -0600)]
Merge pull request #18048 from opensourcerouting/msdpt3f

pimd: fix DR election race on startup

2 months agoMerge pull request #14105 from routingrocks/pim_ageout_fix
Rafael Zalamena [Fri, 7 Feb 2025 00:25:45 +0000 (21:25 -0300)]
Merge pull request #14105 from routingrocks/pim_ageout_fix

pimd: Fix for FHR mroute taking longer to age out

2 months agopimd: fix DR election race on startup 18048/head
Rafael Zalamena [Thu, 6 Feb 2025 22:28:50 +0000 (19:28 -0300)]
pimd: fix DR election race on startup

In case interface address is learnt during configuration, make sure to
run DR election when configuring PIM/PIM passive on interface.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 months agoMerge pull request #18033 from donaldsharp/isis_leak_lists
Russ White [Thu, 6 Feb 2025 18:14:50 +0000 (13:14 -0500)]
Merge pull request #18033 from donaldsharp/isis_leak_lists

isisd: Do not leak a linked list in the circuit

2 months agobgpd: rfapi: if BGP is terminating, free peer BPIs now instead of using timer 18045/head
G. Paul Ziemba [Thu, 6 Feb 2025 16:08:38 +0000 (08:08 -0800)]
bgpd: rfapi: if BGP is terminating, free peer BPIs now instead of using timer

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2 months agoMerge pull request #18038 from opensourcerouting/msdp-filter-leak
Jafar Al-Gharaibeh [Thu, 6 Feb 2025 16:31:31 +0000 (10:31 -0600)]
Merge pull request #18038 from opensourcerouting/msdp-filter-leak

pimd: fix memory leak and assign allocation type

2 months agopimd: Fix for FHR mroute taking longer to age out 14105/head
Rajesh Varatharaj [Thu, 27 Jul 2023 06:57:04 +0000 (23:57 -0700)]
pimd: Fix for FHR mroute taking longer to age out

Issue:
When there is no traffic for a group, the LHR and RP take the default KAT+Join timer expiry of
a maximum of 480 seconds to clear the S,G . However, in the FHR, we update the state from JOINED
to NOT Joined, downstream state from PPto NOINFO.  This restarts the ET timer, causing S,G on FHR to
take more than 10 minutes to age out.

In other words,
Consider a case where (S,G) is in Join state. When the traffic stops and the KAT (210) expires,
 the Join expiry timer restarts. At this time, if we receive a prune, the expectation is to set
 PPT to 0 (RFC 4601 sec 4.5.2).
 When the PPT expires, we move to the noinfo state and restart the expiry timer one more time. We remove the
 (S,G) entry only after ~10 minutes when there is no active traffic.

Summary:
KAT Join ET 210 + PP ET 210 + NOINFO ET 210.

Solution:
Delete the ifchannel when in noinfo state, and KAT is not running.

Ticket: #13703

Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2 months agoMerge pull request #17865 from donaldsharp/coverity_2024_new_hotness
Jafar Al-Gharaibeh [Thu, 6 Feb 2025 16:15:55 +0000 (10:15 -0600)]
Merge pull request #17865 from donaldsharp/coverity_2024_new_hotness

Coverity 2024 new hotness

2 months agoMerge pull request #18029 from donaldsharp/more_support_bundle_data
Martin Winter [Thu, 6 Feb 2025 14:12:49 +0000 (15:12 +0100)]
Merge pull request #18029 from donaldsharp/more_support_bundle_data

tools: Add some more support bundle commands

2 months agoMerge pull request #18025 from donaldsharp/remove_sbfd_pymark
Mark Stapp [Thu, 6 Feb 2025 13:58:27 +0000 (08:58 -0500)]
Merge pull request #18025 from donaldsharp/remove_sbfd_pymark

tests: Remove improper pymark

2 months agopimd: fix memory leak and assign allocation type 18038/head
Rafael Zalamena [Thu, 6 Feb 2025 13:14:55 +0000 (10:14 -0300)]
pimd: fix memory leak and assign allocation type

Use a memory allocation specific type for filter names (to help detect memory
leaks) and fix a memory leak when releasing peer memory.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 months agoisisd: Remove unneeded modify functions 18034/head
Donald Sharp [Thu, 6 Feb 2025 01:46:25 +0000 (20:46 -0500)]
isisd: Remove unneeded modify functions

Our infrastructure was complaining about this:

2025/02/05 19:38:42 ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'modify' callback for '/frr-isisd:isis/instance/fast-reroute/level-1/lfa/tiebreaker/type'
2025/02/05 19:38:42 ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'modify' callback for '/frr-isisd:isis/instance/fast-reroute/level-2/lfa/tiebreaker/type'

Seems we don't need it.  Let's just remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoisisd: Do not leak a linked list in the circuit 18033/head
Donald Sharp [Thu, 6 Feb 2025 01:15:01 +0000 (20:15 -0500)]
isisd: Do not leak a linked list in the circuit

Address sanitizer was telling us that linked lists
were being leaked.  No need to do so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #17987 from pguibert6WIND/evpn_bgp_l2_attr_ext_community
Russ White [Wed, 5 Feb 2025 15:17:46 +0000 (10:17 -0500)]
Merge pull request #17987 from pguibert6WIND/evpn_bgp_l2_attr_ext_community

bgpd: add L2 attr community support as per RFC8214

2 months agoMerge pull request #17901 from opensourcerouting/nexthop_hashing
Donald Sharp [Wed, 5 Feb 2025 14:14:58 +0000 (09:14 -0500)]
Merge pull request #17901 from opensourcerouting/nexthop_hashing

lib: actually hash all 16 bytes of IPv6 addresses, not just 4

2 months agotools: Add some more support bundle commands 18029/head
Donald Sharp [Wed, 5 Feb 2025 14:06:21 +0000 (09:06 -0500)]
tools: Add some more support bundle commands

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agobfdd: Use pass by reference for bfd_key_delete 18026/head
Donald Sharp [Wed, 5 Feb 2025 13:47:31 +0000 (08:47 -0500)]
bfdd: Use pass by reference for bfd_key_delete

Coverity is pointing out that bfd_key_delete is
passing by value instead of reference for a very
large structure.  Double plus not good.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agobfdd: Use pass by reference instead of pass by value for a struct
Donald Sharp [Wed, 5 Feb 2025 13:42:00 +0000 (08:42 -0500)]
bfdd: Use pass by reference instead of pass by value for a struct

The function bfd_key_lookup is currently sending by value for
a now very large structure.  Let's convert this over to pass
by reference.  This is noticed by coverity.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #18014 from donaldsharp/nexthop_leak 17928/head 18028/head
Russ White [Wed, 5 Feb 2025 13:32:13 +0000 (08:32 -0500)]
Merge pull request #18014 from donaldsharp/nexthop_leak

Nexthop leak

2 months agoMerge pull request #18018 from forrestchu/sbfd
Donald Sharp [Wed, 5 Feb 2025 13:17:52 +0000 (08:17 -0500)]
Merge pull request #18018 from forrestchu/sbfd

doc: fix sbfd.rst doc warnings

2 months agotests: Remove improper pymark 18025/head
Donald Sharp [Wed, 5 Feb 2025 13:16:03 +0000 (08:16 -0500)]
tests: Remove improper pymark

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #18000 from donaldsharp/bgp_eoiu_mem_leak
Jafar Al-Gharaibeh [Wed, 5 Feb 2025 05:20:42 +0000 (23:20 -0600)]
Merge pull request #18000 from donaldsharp/bgp_eoiu_mem_leak

bgpd: Fix up memory leak in processing eoiu marker

2 months agodoc: fix sbfd.rst doc warnings 18018/head
wumu.zsl [Wed, 5 Feb 2025 02:18:23 +0000 (02:18 +0000)]
doc: fix sbfd.rst doc warnings

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2 months agozebra: Fix srv6 segment nexthop memory leak. 18014/head
Donald Sharp [Tue, 4 Feb 2025 20:13:48 +0000 (15:13 -0500)]
zebra: Fix srv6 segment nexthop memory leak.

The srv6 segment was being set but never freed
on the statically allocated nexthop.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #17962 from donaldsharp/fpm_problems
Russ White [Tue, 4 Feb 2025 20:09:05 +0000 (15:09 -0500)]
Merge pull request #17962 from donaldsharp/fpm_problems

Fpm problems

2 months agozebra: Stop leaking labels when receiving nexthops from kernel
Donald Sharp [Tue, 4 Feb 2025 20:00:12 +0000 (15:00 -0500)]
zebra: Stop leaking labels when receiving nexthops from kernel

This leak is happening:
Direct leak of 96 byte(s) in 2 object(s) allocated from:
    0 0x7f6922eb83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    1 0x7f6922a38ebb in qcalloc lib/memory.c:106
    2 0x7f6922a553d6 in nexthop_add_srv6_seg6 lib/nexthop.c:652
    3 0x562825e56b38 in parse_nexthop_unicast zebra/rt_netlink.c:589
    4 0x562825e58c4a in netlink_route_change_read_unicast_internal zebra/rt_netlink.c:1291
    5 0x562825e58eef in netlink_route_change_read_unicast zebra/rt_netlink.c:1321
    6 0x562825e64921 in netlink_route_change zebra/rt_netlink.c:1494
    7 0x562825e43407 in netlink_information_fetch zebra/kernel_netlink.c:407
    8 0x562825e439b5 in netlink_parse_info zebra/kernel_netlink.c:1148
    9 0x562825e44060 in kernel_read zebra/kernel_netlink.c:510
    10 0x7f6922aeca72 in event_call lib/event.c:1984
    11 0x7f6922a19e01 in frr_run lib/libfrr.c:1246
    12 0x562825e4b0b9 in main zebra/main.c:543
    13 0x7f692250c249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Just check to see if it has been allocated.  The nexthop is a stack
variable so it's a bit odd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #17988 from cscarpitta/feature/srv6-ipv4-traffic-steering
Russ White [Tue, 4 Feb 2025 16:45:02 +0000 (11:45 -0500)]
Merge pull request #17988 from cscarpitta/feature/srv6-ipv4-traffic-steering

staticd: Add CLI to support steering of IPv4 traffic over SRv6 SID list

2 months agoMerge pull request #17953 from donaldsharp/limit_ip_protocol
Russ White [Tue, 4 Feb 2025 16:43:10 +0000 (11:43 -0500)]
Merge pull request #17953 from donaldsharp/limit_ip_protocol

lib: Remove System routes from ip protocol route map choices

2 months agoMerge pull request #17918 from lsang6WIND/bgp_evpn_route_map
Russ White [Tue, 4 Feb 2025 16:42:42 +0000 (11:42 -0500)]
Merge pull request #17918 from lsang6WIND/bgp_evpn_route_map

Add bgpevpn route type-2 route map filter tests

2 months agoMerge pull request #17896 from opensourcerouting/fix/bgp_oad_extended_communities
Russ White [Tue, 4 Feb 2025 16:42:16 +0000 (11:42 -0500)]
Merge pull request #17896 from opensourcerouting/fix/bgp_oad_extended_communities

bgpd: Send non-transitive extended communities from/to OAD peers

2 months agoMerge pull request #16593 from baozhen-H3C/202408151540
Russ White [Tue, 4 Feb 2025 16:39:29 +0000 (11:39 -0500)]
Merge pull request #16593 from baozhen-H3C/202408151540

isisd: 'tiebreaker' command line funtionality is inconsistent with its implementation

2 months agoMerge pull request #17985 from pguibert6WIND/evpn_ead_label_support
Russ White [Tue, 4 Feb 2025 16:39:03 +0000 (11:39 -0500)]
Merge pull request #17985 from pguibert6WIND/evpn_ead_label_support

bgpd: fix add label support to EVPN AD routes

2 months agoMerge pull request #17959 from opensourcerouting/fix/bgp_deny_zero_bgp_identifier_to_...
Russ White [Tue, 4 Feb 2025 16:31:57 +0000 (11:31 -0500)]
Merge pull request #17959 from opensourcerouting/fix/bgp_deny_zero_bgp_identifier_to_establish

bgpd: Do not start BGP session if BGP identifier is not set

2 months agobuild: FRR 10.4 development version frr-10.4-dev
Jafar Al-Gharaibeh [Tue, 4 Feb 2025 16:21:51 +0000 (10:21 -0600)]
build: FRR 10.4 development version

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 months agoMerge pull request #17969 from donaldsharp/fpm_lost_sends base_10.3
Mark Stapp [Tue, 4 Feb 2025 16:18:07 +0000 (11:18 -0500)]
Merge pull request #17969 from donaldsharp/fpm_lost_sends

zebra: Ensure dplane does not send work back to master at wrong time

2 months agobgpd: Fix up memory leak in processing eoiu marker 18000/head
Donald Sharp [Tue, 4 Feb 2025 15:56:59 +0000 (10:56 -0500)]
bgpd: Fix up memory leak in processing eoiu marker

Memory is being leaked when processing the eoiu marker.
BGP is creating a dummy dest to contain the data but
it was never freed.  As well as the eoiu info was
not being freed either.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agobgpd: add L2 attr community support as per RFC8214 17987/head
Philippe Guibert [Mon, 3 Feb 2025 15:08:45 +0000 (16:08 +0100)]
bgpd: add L2 attr community support as per RFC8214

The L2 attribute extended community can not be decoded when using L2VPN
EVPN as a route reflector. Decode the extended community and dump the
detailed information about flags and MTU information.

> rt4# show bgp l2vpn evpn
> BGP table version is 1, local router ID is 4.4.4.4
> Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
> Origin codes: i - IGP, e - EGP, ? - incomplete
> EVPN type-1 prefix: [1]:[EthTag]:[ESI]:[IPlen]:[VTEP-IP]:[Frag-id]
> EVPN type-2 prefix: [2]:[EthTag]:[MAClen]:[MAC]:[IPlen]:[IP]
> EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:[OrigIP]
> EVPN type-4 prefix: [4]:[ESI]:[IPlen]:[OrigIP]
> EVPN type-5 prefix: [5]:[EthTag]:[IPlen]:[IP]
>
>    Network          Next Hop            Metric LocPrf Weight Path
> Route Distinguisher: 1.1.1.1:100
>  *>i[1]:[12]:[00:00:00:00:00:00:00:00:00:00]:[32]:[0.0.0.0]:[0]
>                     1.1.1.1                       100      0 i
>                     RT:65500:100 L2: P flag:N, B Flag N, C word N, MTU 0
> Route Distinguisher: 5.5.5.5:100
>  *>i[1]:[10]:[00:00:00:00:00:00:00:00:00:00]:[32]:[0.0.0.0]:[0]
>                     5.5.5.5                       100      0 i
>                     RT:65500:100 L2: P flag:N, B Flag N, C word N, MTU 0
>

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agotests: bgp_vpnv4_route_leak_basic add del static prefix 17370/head
Louis Scalbert [Tue, 5 Nov 2024 16:13:38 +0000 (17:13 +0100)]
tests: bgp_vpnv4_route_leak_basic add del static prefix

In bgp_vpnv4_route_leak_basic, remove and add back the static prefix
172.16.3.0/24 on VRF DONNA. Before the previous fixes, the 172.16.3.0/24
prefix re-appeared when it was added back in the VPN table but it was
marked as invalid.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agotests: check bgp vpn table in bgp_vpnv4_route_leak_basic
Louis Scalbert [Wed, 6 Nov 2024 10:11:19 +0000 (11:11 +0100)]
tests: check bgp vpn table in bgp_vpnv4_route_leak_basic

Check bgp vpn table in bgp_vpnv4_route_leak_basic

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agotests: fix no vrf1 in bgp_bmp r2
Louis Scalbert [Thu, 14 Nov 2024 10:28:24 +0000 (11:28 +0100)]
tests: fix no vrf1 in bgp_bmp r2

The bgp_bmp test is failing because r2 lacks the vrf1 VRF, which
prevents it from exporting VPN prefixes from the configured vrf1 BGP
instance. Previous versions allowed the export of static BGP prefixes
from a non-existent VRF, so the test passed under those conditions.

Add a vrf1 VRF on r2.

Fixes: d748544769 ("topotests: add basic bgp bmp test")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agotests: update route_leak_basic tests
Louis Scalbert [Wed, 6 Nov 2024 13:28:12 +0000 (14:28 +0100)]
tests: update route_leak_basic tests

Update route_leak_basic tests. The routes with an unusable nexthop VRF
are no more present in the RIB.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agobgpd: do not leak if origin vrf is not usable
Louis Scalbert [Wed, 6 Nov 2024 14:25:35 +0000 (15:25 +0100)]
bgpd: do not leak if origin vrf is not usable

Do not leak if origin vrf is not usable

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agobgpd: recheck leak nexthop validity
Louis Scalbert [Tue, 5 Nov 2024 14:53:43 +0000 (15:53 +0100)]
bgpd: recheck leak nexthop validity

When leak_update() rechecks an existing path, it considers nothing to
update if the attributes and labels are not changed. However, it does
not take into account the nexthop validity.

Perform a leak update if the nexthop validity has changed.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agobgpd: check nexthop vrf usability
Louis Scalbert [Wed, 6 Nov 2024 12:52:03 +0000 (13:52 +0100)]
bgpd: check nexthop vrf usability

Mark a nexthop as invalid if the origin VRF is unusable, either because
it does not exist or its interface is down.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agobgpd: merge parent and source_bpi in leak_update
Louis Scalbert [Thu, 14 Nov 2024 14:45:25 +0000 (15:45 +0100)]
bgpd: merge parent and source_bpi in leak_update

They are the same value.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agoMerge pull request #17992 from chiragshah6/fdev5
Russ White [Tue, 4 Feb 2025 12:40:36 +0000 (07:40 -0500)]
Merge pull request #17992 from chiragshah6/fdev5

bgpd: fix route-distinguisher in vrf leak json cmd

2 months agoMerge pull request #17991 from chiragshah6/bgp_dev4
Donatas Abraitis [Tue, 4 Feb 2025 12:34:21 +0000 (14:34 +0200)]
Merge pull request #17991 from chiragshah6/bgp_dev4

zebra: fix evpn svd hash avoid double free

2 months agoMerge pull request #17943 from opensourcerouting/clear-event-cpu-uaf
Russ White [Tue, 4 Feb 2025 11:57:52 +0000 (06:57 -0500)]
Merge pull request #17943 from opensourcerouting/clear-event-cpu-uaf

lib: fix use after free in `clear event cpu`

2 months agoMerge pull request #17336 from forrestchu/sbfd
Russ White [Tue, 4 Feb 2025 11:36:43 +0000 (06:36 -0500)]
Merge pull request #17336 from forrestchu/sbfd

implement SBFD

2 months agoisisd: 'tiebreaker' command line funtionality is inconsistent with its implementation 16593/head
b29332 [Thu, 15 Aug 2024 08:20:19 +0000 (16:20 +0800)]
isisd: 'tiebreaker' command line funtionality is inconsistent with its implementation

The command fast-reroute lfa tiebreaker [downstream | lowest-backup-metric | node-protecting] index (1-255) [level-1 | level-2] will overwrite configurations with the same index but different types. This is because the index is set as the key in frr-isisd.yang. However, the lfa_tiebreaker_cmp function uses a tuple (index, type) as the key. Therefore, the yang file should be modified to stay in sync with the business logic.

Test Scenario:
On RouterA, first configure fast-reroute lfa tiebreaker downstream index 100 level-1, then configure fast-reroute lfa tiebreaker lowest-backup-metric index 100 level-1, and check the configuration:

!
router isis 10
 fast-reroute lfa tiebreaker lowest-backup-metric index 100 level-1
exit
!

Signed-off-by: baozhen-H3C <bao.zhen@h3c.com>
2 months agoMerge pull request #17990 from enkechen-panw/aigp-cfg-default
Donatas Abraitis [Tue, 4 Feb 2025 08:51:52 +0000 (10:51 +0200)]
Merge pull request #17990 from enkechen-panw/aigp-cfg-default

bgpd: add config default for "bgp bestpath aigp"

2 months agoMerge pull request #17989 from cscarpitta/fix/fix_staticd_no_sid
Donatas Abraitis [Tue, 4 Feb 2025 08:47:20 +0000 (10:47 +0200)]
Merge pull request #17989 from cscarpitta/fix/fix_staticd_no_sid

staticd: Fix wrong xpath in `no sid X:X::X:X/M`

2 months agobgpd: fix route-distinguisher in vrf leak json cmd 17992/head
Chirag Shah [Mon, 3 Feb 2025 20:00:41 +0000 (12:00 -0800)]
bgpd: fix route-distinguisher in vrf leak json cmd

For auto configured value RD value comes as NULL,
switching back to original change will ensure to cover
for both auto and user configured RD value in JSON.

tor-11# show bgp vrf blue ipv4 unicast route-leak json
{
  "vrf":"blue",
  "afiSafi":"ipv4Unicast",
  "importFromVrfs":[
    "purple"
  ],
  "importRts":"10.10.3.11:6",
  "exportToVrfs":[
    "purple"
  ],
  "routeDistinguisher":"(null)", <<<<<
  "exportRts":"10.10.3.11:10"
}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 months agozebra: evpn svd hash avoid double free 17991/head
Chirag Shah [Fri, 31 Jan 2025 01:26:46 +0000 (17:26 -0800)]
zebra: evpn svd hash avoid double free

Upon zebra shutdown hash_clean_and_free is called
where user free function is passed,
The free function should not call hash_release
which lead to double free of hash bucket.

Fix:
The fix is to avoid calling hash_release from
free function if its called from hash_clean_and_free
path.

10 0x00007f0422b7df1f in free () from /lib/x86_64-linux-gnu/libc.so.6
11 0x00007f0422edd779 in qfree (mt=0x7f0423047ca0 <MTYPE_HASH_BUCKET>,
    ptr=0x55fc8bc81980) at ../lib/memory.c:130
12 0x00007f0422eb97e2 in hash_clean (hash=0x55fc8b979a60,
    free_func=0x55fc8a529478 <svd_nh_del_terminate>) at
    ../lib/hash.c:290
13 0x00007f0422eb98a1 in hash_clean_and_free (hash=0x55fc8a675920
    <svd_nh_table>, free_func=0x55fc8a529478 <svd_nh_del_terminate>) at
    ../lib/hash.c:305
14 0x000055fc8a5323a5 in zebra_vxlan_terminate () at
    ../zebra/zebra_vxlan.c:6099
15 0x000055fc8a4c9227 in zebra_router_terminate () at
    ../zebra/zebra_router.c:276
16 0x000055fc8a4413b3 in zebra_finalize (dummy=0x7fffb881c1d0) at
    ../zebra/main.c:269
17 0x00007f0422f44387 in event_call (thread=0x7fffb881c1d0) at
    ../lib/event.c:2011
18 0x00007f0422ecb6fa in frr_run (master=0x55fc8b733cb0) at
    ../lib/libfrr.c:1243
19 0x000055fc8a441987 in main (argc=14, argv=0x7fffb881c4a8) at
    ../zebra/main.c:584

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 months agotests: Add test case to verify SID re-add 17989/head
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:51 +0000 (12:56 +0100)]
tests: Add test case to verify SID re-add

Add a new test case that re-add the deleted SIDs and verifies that all
SIDs are added back to the RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agotests: Add test case to verify SID delete
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:41 +0000 (12:56 +0100)]
tests: Add test case to verify SID delete

Add a new test case that deletes a SID and verifies that only this
SID has been removed from the RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agostaticd: Fix wrong xpath in `no sid X:X::X:X/M`
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:02 +0000 (12:56 +0100)]
staticd: Fix wrong xpath in `no sid X:X::X:X/M`

When a user wants to delete a specific SRv6 SID, he executes the
`no sid X:X::X:X/M` command.
However, by mistake, in addition to deleting the SID requested by the
user, this command also removes all other SIDs.

This happens because `no sid X:X::X:X/M` triggers a destroy operation
on the wrong xpath `frr-staticd:staticd/segment-routing/srv6`.

This commit fixes the issue by replacing the wrong xpath
`frr-staticd:staticd/segment-routing/srv6` with the correct xpath
`frr-staticd:staticd/segment-routing/srv6/static-sids/sid[sid='%s']`.

This ensures that the `no sid X:X::X:X/M` command only deletes the SID
that was requested by the user.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agotests: Add topotest for SRv6 IPv4 traffic steering 17988/head
Carmine Scarpitta [Tue, 24 Dec 2024 08:42:34 +0000 (09:42 +0100)]
tests: Add topotest for SRv6 IPv4 traffic steering

Add a topotest to verify the newly introduced CLI to support
steering of IPv4 traffic over an SRv6 SID list.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agodoc: Add documentation for SRv6 IPv4 traffic steering
Carmine Scarpitta [Tue, 24 Dec 2024 08:22:52 +0000 (09:22 +0100)]
doc: Add documentation for SRv6 IPv4 traffic steering

Add an example of how to steer IPv4 traffic over an SRv6 SID list.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agostaticd: Extend `ip_route_vrf` CLI to support SRv6 traffic steering
Carmine Scarpitta [Tue, 24 Dec 2024 07:59:18 +0000 (08:59 +0100)]
staticd: Extend `ip_route_vrf` CLI to support SRv6 traffic steering

staticd already has a CLI to steer IPv6 traffic over a given SRv6 SID
list:

```
vrf vrf10
 ipv6 route 2001:db8:1:1::/64 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

This PR extends the existing CLI `ip route` to support steering of IPv4
traffic over an SRv6 SID list.

```
vrf vrf10
 ip route 10.0.0.0/24 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agostaticd: Extend `ip_route` CLI to support SRv6 traffic steering
Carmine Scarpitta [Tue, 24 Dec 2024 07:58:41 +0000 (08:58 +0100)]
staticd: Extend `ip_route` CLI to support SRv6 traffic steering

staticd already has a CLI to steer IPv6 traffic over a given SRv6 SID
list:

```
ipv6 route 2001:db8:1:1::/64 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

This PR extends the existing CLI `ip route` to support steering of IPv4
traffic over an SRv6 SID list.

```
ip route 10.0.0.0/24 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>