Commit Graph

38268 Commits

Author SHA1 Message Date
Donald Sharp
ffff1a1760 bgpd: Fix another crash in orf
I was pointed at yet another crash in the orf code.  I think it
stems from basicaly the same problem as the last one.  Let's just
make sure that the orf_plist is handled appropriately.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-19 06:29:36 -05:00
Russ White
5082cab809
Merge pull request #18164 from Pdoijode/pdoijode/staticd-nht-register
staticd: Failed to register nexthop after networking restart
2025-02-18 09:18:29 -05:00
Russ White
77ab298369
Merge pull request #18189 from Shbinging/fix_ip_rip_split-horizon
doc: correct `ip rip split-horizon` command in the documentation
2025-02-18 09:16:46 -05:00
Russ White
3eedab0928
Merge pull request #18095 from opensourcerouting/zebra-check-class-e
Use ipv4 class E addresses (240.0.0.0/4) as connected routes by default
2025-02-18 08:31:31 -05:00
Carmine Scarpitta
b85cf812c2
Merge pull request #17957 from pguibert6WIND/codepoint_add_some_flavors
isisd, lib: add some codepoints usually shared with other vendors
2025-02-18 11:06:51 +01:00
Shbinging
5256a8b5c0 doc: correct ip rip split-horizon command in the RIP documentation.
The previous version incorrectly spelled the command as `ip split-horizon`. The correct command is `ip rip split-horizon`, as indicated in the code at line 675 of rip_cli.c.

Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2025-02-18 15:37:19 +08:00
Jafar Al-Gharaibeh
4315f2eedb
Merge pull request #18082 from LabNConsulting/chopps/fix-yang-config-destroy
lib: nb: call child destroy CBs when YANG container is deleted
2025-02-17 20:35:49 -06:00
Donatas Abraitis
b6ae929c1d
Merge pull request #16796 from gtataranni/feat/logfmt
tools: add logfmt option for frr-reload.py
2025-02-17 23:02:27 +02:00
Giovanni Tataranni
44a6e0dfed tools: add logfmt option for frr-reload.py
Add the option of printing logs in logfmt format.

Additional machine readable information can be printed via the `extra`
argument.
Example:
```python
log.debug("exit context"), extra={"line": line, "ctx_keys": ctx_keys})

log.error(f"Failed to execute command {' '.join(cmd)}", extra={"cmd": cmd})
```

Signed-off-by: Giovanni Tataranni <g.tataranni@gmail.com>
2025-02-17 17:33:28 +01:00
Christian Hopps
e241882d8f
Merge pull request #18139 from y-bharath14/srib-yang-v2
yang: Default value for a key leaf to be ignored
2025-02-17 05:13:57 -05:00
Donald Sharp
197d12ffba
Merge pull request #18187 from cscarpitta/fix/fix_srv6_encap_src_addr_test_failures
tests: Fix intermittent failures in `srv6_encap_src_addr` topotest
2025-02-16 08:09:18 -05:00
Carmine Scarpitta
c621b5e759 tests: Fix intermittent failures in srv6_encap_src_addr topotest
The `srv6_encap_src_addr` runs a vtysh command to configure the SRv6
encapsulation source address and then immediately invokes an iproute2
command to verify that zebra has set this address in the kernel. There
is no wait between the two operations and the verification is attempted
only once. If the topotest does not find the expected address it fails
immediately.

The problem is that when topotest is run on a heavyily loaded system,
it can take some time for zebra to set the address in the kernel.
In this case, when the topotest checks the kernel address right after
running the vtysh command, it doesn't find the expected address because
zebra hasn't set it yet.

This commit gives zebra some time to configure the address. It keeps to
check that the address is the expected one for about 1 minute. If after
1 minute the address is not the expected one then the test fails.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-16 11:14:54 +01:00
Carmine Scarpitta
206a647ea6 tests: Increase retry timeout in srv6_encap_src_addr topotest
The `srv6_encap_src_addr` topotest uses a waiting time that is too
small. For this reason during startup it prints a warning:

```
2025-02-16 09:23:47,704 WARNING: topo: Waiting time is too small (count=10, wait=1), using default values (count=20, wait=3)
```

This commit increases the waiting time to fix the warning.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-16 11:01:01 +01:00
Carmine Scarpitta
d8483f410e tests: Do not load bgpd config in srv6_encap_src_addr topotest
The `srv6_encap_src_addr` topotest tries to load bgpd.conf file that
does not exist, which produces the following warning:

```
2025-02-16 09:23:35,151 WARNING: topo: missing config 'r1' for '/media/frr/tests/topotests/srv6_encap_src_addr/r1/bgpd.conf' creating empty file '/etc/frr/bgpd.conf'
```

Since this topotest doesn't actually use bgpd, there's no point in
loading the config file.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-16 11:01:01 +01:00
Carmine Scarpitta
cb38a6f962 tests: Do not load sharpd config in srv6_encap_src_addr topotest
The `srv6_encap_src_addr` topotest tries to load sharpd.conf file that
does not exist, which produces the following warning:

```
2025-02-16 09:23:35,151 WARNING: topo: missing config 'r1' for '/media/frr/tests/topotests/srv6_encap_src_addr/r1/sharpd.conf' creating empty file '/etc/frr/sharpd.conf'
```

Since this topotest doesn't actually use sharpd, there's no point in
loading the config file.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-16 11:00:36 +01:00
Carmine Scarpitta
f2bf1f95b3 tests: Remove bgpd marker in srv6_encap_src_addr topotest
The `srv6_encap_src_addr` does not use bgp. As such, it should not have
bgpd marker.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-16 09:51:22 +01:00
Donatas Abraitis
88f4bb2761
Merge pull request #18109 from mjstapp/fix_evpn_vty_rt
bgpd: fix vty output of evpn route-target AS4
2025-02-15 22:11:00 +02:00
Donald Sharp
b2c960a19d
Merge pull request #18178 from cscarpitta/fix/isis_request_srv6_locator
isisd: Request SRv6 locator after zebra connection
2025-02-15 09:39:04 -05:00
Donald Sharp
ca46b52436
Merge pull request #18163 from opensourcerouting/sharpd-crash-command
sharpd: add `crashme` commands
2025-02-15 09:17:10 -05:00
Carmine Scarpitta
f02dba19d2 isisd: Request SRv6 locator after zebra connection
When SRv6 is enabled and an SRv6 locator is specified in the IS-IS
configuration, IS-IS 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/14 21:41:20 ISIS: [HR66R-TWQYD][EC 100663302] srv6_manager_get_locator: invalid zclient socket
````

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

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

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-15 10:39:40 +01:00
Carmine Scarpitta
0b76fb3c13 isisd: Add helper function to request SRv6 locator information
This commit adds a function that iterates over all IS-IS areas and asks
the SRv6 Manager for information about the configured locators.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-15 10:39:30 +01:00
David Lamparter
050989d2fb
Merge pull request #18160 from donaldsharp/orf_plist_argie_bargie
bgpd: When removing the prefix list drop the pointer
2025-02-14 22:28:09 +01:00
Donatas Abraitis
d8ea27a188
Merge pull request #18122 from louis-6wind/bgp_cleanup_table-factorize
bgpd: factorize bgp_table_cleanup()
2025-02-14 23:08:51 +02:00
Pooja Jagadeesh Doijode
c1adc8f1d6 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 3c05d53bf8. 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>
2025-02-14 12:12:11 -08:00
Christian Hopps
d03ecf4562 lib: nb: call child destroy CBs when YANG container is deleted
Previously the code was only calling the child destroy callbacks if the target
deleted node was a non-presence container. We now add a flag to the callback
structure to instruct northbound to perform the rescursive delete for code that
wishes for this to happen.

- Fix wrong relative path lookup in keychain destroy callback

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-14 18:14:30 +00:00
David Lamparter
cda7c4ed31 sharpd: add crashme commands
This adds 2 commands, one that should just straight up SEGV, another
that should trip an ASAN warning for an use-after-free.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-02-14 17:31:18 +01:00
Philippe Guibert
53263b4b62 isisd, lib: add some codepoints usually shared with other vendors
Some codepoints can not be read by interoperating with CISCO.
This is because PSP/USP flavor are used by default, and the display of
the isis output has to be adapted.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-02-14 15:40:42 +01:00
David Schweizer
1951e713d2
doc: Update description of 'allow-reserved-ranges'
Update user documentation to reflect behavior of config command
'allow-reserved-ranges' after changes enable use of ipv4 class E
addresses by default.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2025-02-14 15:05:08 +01:00
David Schweizer
1eef3a77e3
lib,zebra: Allow class E prefixes in RIB
Changes allow ipv4 class E addresses and prefixes in the 240.0.0.0/4
range to be configured on interfaces, imported from the kernel routing
table and redistributed as connected routes in zebra by default.

Changes also fix routes with class E prefixes in kernel routing table
getting rejected by zebra during early daemon startup.

Drivin this change in default behavior are cloud providers (with
customers still using obsolete ipv4 protocol, i.e. Azure, AWS) running
out of ip space and abusing class E for addressing instances (announced
via BGP) over tunneling connections back to customers on premise
infrastructure.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2025-02-14 15:05:08 +01:00
Donald Sharp
3d43d7b789 bgpd: When removing the prefix list drop the pointer
We are very very rarely seeing this crash:

    0 0x7f36ba48e389 in prefix_list_apply_ext lib/plist.c:789
    1 0x55eff3fa4126 in subgroup_announce_check bgpd/bgp_route.c:2334
    2 0x55eff3fa858e in subgroup_process_announce_selected bgpd/bgp_route.c:3440
    3 0x55eff4016488 in subgroup_announce_table bgpd/bgp_updgrp_adv.c:808
    4 0x55eff401664e in subgroup_announce_route bgpd/bgp_updgrp_adv.c:861
    5 0x55eff40111df in peer_af_announce_route bgpd/bgp_updgrp.c:2223
    6 0x55eff3f884cb in bgp_announce_route_timer_expired bgpd/bgp_route.c:5892
    7 0x7f36ba4ec239 in event_call lib/event.c:2019
    8 0x7f36ba41a22a in frr_run lib/libfrr.c:1295
    9 0x55eff3e668b7 in main bgpd/bgp_main.c:557
    10 0x7f36b9e2d249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    11 0x7f36b9e2d304 in __libc_start_main_impl ../csu/libc-start.c:360
    12 0x55eff3e64a30 in _start (/home/ci/cibuild.1407/frr-source/bgpd/.libs/bgpd+0x2fda30)
0x608000037038 is located 24 bytes inside of 88-byte region [0x608000037020,0x608000037078)
freed by thread T0 here:
    0 0x7f36ba8b76a8 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52
    1 0x7f36ba439bd7 in qfree lib/memory.c:131
    2 0x7f36ba48d3a3 in prefix_list_free lib/plist.c:156
    3 0x7f36ba48d3a3 in prefix_list_delete lib/plist.c:247
    4 0x7f36ba48fbef in prefix_bgp_orf_remove_all lib/plist.c:1516
    5 0x55eff3f679c4 in bgp_route_refresh_receive bgpd/bgp_packet.c:2841
    6 0x55eff3f70bab in bgp_process_packet bgpd/bgp_packet.c:4069
    7 0x7f36ba4ec239 in event_call lib/event.c:2019
    8 0x7f36ba41a22a in frr_run lib/libfrr.c:1295
    9 0x55eff3e668b7 in main bgpd/bgp_main.c:557
    10 0x7f36b9e2d249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
previously allocated by thread T0 here:
    0 0x7f36ba8b83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    1 0x7f36ba4392e4 in qcalloc lib/memory.c:106
    2 0x7f36ba48d0de in prefix_list_new lib/plist.c:150
    3 0x7f36ba48d0de in prefix_list_insert lib/plist.c:186
    4 0x7f36ba48d0de in prefix_list_get lib/plist.c:204
    5 0x7f36ba48f9df in prefix_bgp_orf_set lib/plist.c:1479
    6 0x55eff3f67ba6 in bgp_route_refresh_receive bgpd/bgp_packet.c:2920
    7 0x55eff3f70bab in bgp_process_packet bgpd/bgp_packet.c:4069
    8 0x7f36ba4ec239 in event_call lib/event.c:2019
    9 0x7f36ba41a22a in frr_run lib/libfrr.c:1295
    10 0x55eff3e668b7 in main bgpd/bgp_main.c:557
    11 0x7f36b9e2d249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Let's just stop trying to save the pointer around in the peer->orf_plist
data structure.  There are other design problems but at least lets
stop the crash from possibly happening.

Fixes: #18138
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-14 07:58:01 -05:00
David Lamparter
196b7f1c31
Merge pull request #18127 from donaldsharp/w_option_for_watchfrr 2025-02-13 21:31:39 +01:00
Donatas Abraitis
cadfc56c89
Merge pull request #18121 from louis-6wind/fix-lable-release
bgpd: release manual vpn label on instance deletion
2025-02-13 21:08:23 +02:00
Donald Sharp
b9ac2c7b2f
Merge pull request #18080 from opensourcerouting/fix/enable_ll_capability_if_using_unnumerred
bgpd: Some fixes/improvements for Link-Local Next Hop capability
2025-02-13 14:06:24 -05:00
Donatas Abraitis
5d8bef6442
Merge pull request #18142 from donaldsharp/vrf_tableid_debugs
Vrf tableid debugs
2025-02-13 20:52:16 +02:00
Donald Sharp
8a661e5152
Merge pull request #18064 from cscarpitta/fix/fix_srv6_sid_parameters
staticd: Fix SRv6 SID installation and deletion
2025-02-13 13:37:22 -05:00
Carmine Scarpitta
caeef98e73
Merge pull request #18023 from pguibert6WIND/srv6_route_dump
lib: fix false context information for SRv6 route
2025-02-13 18:57:44 +01:00
Philippe Guibert
52a3239b26
Merge pull request #18079 from donaldsharp/labelpool_crash
bgpd: Fix crash in bgp_labelpool
2025-02-13 18:44:19 +01:00
Donald Sharp
9101bff6d2 tools: watchfrr should ignore frr_global_options
watchfrr is currently being started with $frr_global_options
This is problematic as that it has a entirely different cli
than the rest of the daemons and we have no plans to make
this equivalent.

Fixes: #18107

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-13 11:41:27 -05:00
Russ White
fbff0436d3
Merge pull request #18046 from LabNConsulting/aceelindem/ospf-lsa-add-delete-hook
ospfd: Replace LSDB callbacks with LSA Update/Delete hooks.
2025-02-13 11:16:42 -05:00
Rafael Zalamena
80a12477e0 pimd,topotests: frrbot styling suggestions
Incorporate frrbot suggestion to avoid the CI warning.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-13 13:07:34 -03:00
Rafael Zalamena
ee6c4fb7a9 topotests: test IGMPv2/MLDv1 immediate leave
Add new topology for testing IGMPv2/MLDv1 immediate leave and more features
in the future.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-13 13:05:19 -03:00
Rafael Zalamena
16511bf3b0 doc: document new immediate-leave commands
Let user know about this new multicast knob.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-13 12:45:48 -03:00
David Lamparter
df9517c95a pimd: add IGMPv2/MLDv1 immediate-leave
(Somewhat) useful when dealing with an interface that has only one host
attached.  Only works for IGMPv2 and MLDv1, other protocol versions have
no leave message.

Co-authored-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-13 12:45:47 -03:00
Donald Sharp
40744f4f3d zebra: Use tableid when displaying prefix
Found some more instances of tableid not being
displayed when trying to debug something.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-13 10:40:52 -05:00
Donald Sharp
b4786a61e2 pbr: Add tableid to some debugs
Add prefix and tableid to one debug instead of several.
Consolidate a bit.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-13 10:40:17 -05:00
Jafar Al-Gharaibeh
f70530c8e8
Merge pull request #18032 from opensourcerouting/gmp-limit
pimd,pim6d: implement GMP group / source limits
2025-02-13 09:32:07 -06:00
Louis Scalbert
85784be2ec bgpd: remove unused afi arg from bgp_cleanup_table
Remove unused AFI argument from bgp_cleanup_table()

Fixes: ec6e09c271 ("bgpd: fix flushing ipv6 flowspec entries when peering stops")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-13 16:04:33 +01:00
Louis Scalbert
b5014d371c bgpd: factorize bgp_table_cleanup()
Factorize bgp_table_cleanup(). Cosmetic change. It will help adding
AFI / SAFI in the future.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-13 15:59:06 +01:00
Y Bharath
4f7b45f28b yang: Default value for a key leaf to be ignored
In YANG, key leaves are used to uniquely identify list entries, and they
cannot have default values

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-02-13 17:10:46 +05:30
Donatas Abraitis
44fe3981ee zebra: Do not flush an existing vni configuration trying to remove wrong vni
Before:

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

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-02-12 23:37:20 +02:00