Commit graph

38410 commits

Author SHA1 Message Date
Martin Winter 2f171ac023
redhat: Make sure zeromq is always disabled
Fix issue where zeromq is getting enabled if build system has the libs
installed. For RPMs, we want it always based on intended config options.
(and currently the zeromq is not part of the packages)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2025-03-19 13:51:54 +01:00
Martin Winter 972ec6fd8c
redhat: Make docs and rpki optional for RPM package build
Adding options to disable docs and rpki during the build. By
default they are always built. RPKI sub-package will not be built
(and not available) if built without the RPKI support.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2025-03-19 13:51:47 +01:00
Martin Winter 1f815d555c
Revert "redhat: Add option to build pkg without docs and rpki support, allow for different system environments by including all built .so files"
This reverts commit d89f21fc06.

Reverting original change from PR 17793. This commit breaks RPKI
and SNMP sub-packages

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2025-03-19 07:09:00 +01:00
Jafar Al-Gharaibeh b06dd2ccac
Merge pull request #18418 from donaldsharp/ripngd_memory_leaks_on_shutdown
ripngd: Access and Prefix lists are being leaked on shutdown
2025-03-18 22:00:26 -05:00
Jafar Al-Gharaibeh 7323d5c080
Merge pull request #18419 from donaldsharp/typesafe_warning
doc: Modify typesafe documentation
2025-03-18 21:59:29 -05:00
Donald Sharp 6940c1923b doc: Modify typesafe documentation
The typesafe documentation needs a bit of warning about
how they can cause problems on conversion.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-03-18 13:56:28 -04:00
Donald Sharp 95df46ab40 ripngd: Access and Prefix lists are being leaked on shutdown
ripngd:     Access List                   :      1 *         56
ripngd:     Access List Str               :      1 *          3
ripngd:     Access Filter                 :      1 *        112
ripngd:     Prefix List                   :      1 *         88
ripngd:     Prefix List Str               :      1 *          3
ripngd:     Prefix List Entry             :      1 *        136
ripngd:     Prefix List Trie Table        :      4 *       4096

This is now fixed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-03-18 13:40:32 -04:00
Russ White f3d9bd90a1
Merge pull request #18413 from Shbinging/fix_babel_wired
babled: reset wired/wireless internal only when wired/wireless status changed
2025-03-18 11:28:27 -04:00
Russ White 4b6e0ba1a1
Merge pull request #18349 from donaldsharp/more_yang_state
More yang state
2025-03-18 11:02:28 -04:00
Jafar Al-Gharaibeh fe809f47d6
Merge pull request #18414 from y-bharath14/srib-tests-v5
tests: Corrected input dict at pim.py
2025-03-18 09:22:51 -05:00
Russ White ad7e625c15
Merge pull request #18410 from opensourcerouting/fix/print_the_real_reason_supressed_peer
bgpd: Print the real reason why the peer is not accepted (incoming)
2025-03-18 08:46:43 -04:00
Russ White 34b8872699
Merge pull request #18407 from everoute/master
fix(vrrp): display vrrp version by default
2025-03-18 08:45:55 -04:00
Russ White 6278a8357d
Merge pull request #18364 from dmytroshytyi-6WIND/rtadv_disable
bgpd, zebra, tests: disable rtadv when bgp instance unconfiguration.
2025-03-18 08:26:21 -04:00
Russ White 1e69d08fb0
Merge pull request #18275 from opensourcerouting/fix/issue_18222_no_topotest
bgpd: Do not keep stale paths in Adj-RIB-Out if not addpath aware
2025-03-18 08:20:05 -04:00
Y Bharath 066dcf6c20 tests: Corrected input dict at pim.py
Corrected input dict at pim.py

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-03-18 14:47:54 +05:30
Shbinging 6af2af83be babled: set wired/wireless internal only when wired/wireless status changes
As stated in doc, interface's attributes such noninterfering/interfering are reset when the wired/wireless status of an interface is changed. If wired/wireless status is not changed, such as wired->wired, we should not reset internal attributes.

Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2025-03-18 10:38:12 +08:00
Donatas Abraitis f47b2fb94a bgpd: Move stale Adj-RIB-Out paths removal to subgroup_process_announce_selected()
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-03-17 16:02:16 +02:00
Donatas Abraitis 4c79c560d1 tests: Check if addpath with disabled RX flag is working correctly in RS setup
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-03-17 16:02:16 +02:00
Donatas Abraitis eecfea9768 bgpd: Do not remove the path from Adj-Rib-Out if it's a selected route
There was a case where removing the selected (single best) route leads to
adj-rib-out to be vanished at all.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-03-17 16:02:16 +02:00
Donatas Abraitis cc6c3d7a20 bgpd: Do not keep stale paths in Adj-RIB-Out if not addpath aware
```
munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 5, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.100                10      0 65100 65444 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i
```

Announce one more 10.0.0.0/24 via 65200 and we have TWO paths 10.0.0.0/24 in adj-rib-out:

```
munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 6, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.100                10      0 65100 65444 65444 i
 *> 10.0.0.0/24      192.168.137.201                10      0 65200 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i
```

Stop announcing 10.0.0.0/24 via 65200 and we still have TWO paths for 10.0.0.0/24...

```
munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 7, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.100                10      0 65100 65444 65444 i
 *> 10.0.0.0/24      192.168.137.201                10      0 65200 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i
```

Why do we need to keep old paths in adj-rib-out if we don't have e.g. AddPaths enabled?

Shouldn't it be like here? (only one 10.0.0.0/24 in adj-rib-out for this update-group instead of multiple (stale from previous announcements))

```
munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 6, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.201                10      0 65200 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-03-17 16:02:16 +02:00
Donatas Abraitis ace4b8fe61 bgpd: Print the real reason why the peer is not accepted (incoming)
If it's suppressed due to BFD down or unspecified connection, we never know
the real reason and just say "no AF activated" which is misleading.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-03-17 14:52:42 +02:00
Dmytro Shytyi 8f47d0f1b7
tests: add rtadv topotest
Verify the new rtadv "show interface json" fields
The rtadv json parameters should not be present
when bgp instance is disabled.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2025-03-17 11:33:09 +01:00
Dmytro Shytyi e6d08a89c7
zebra: add rtadv information output in vtysh json
Add to "show interface json" output multiple rtadv parameters.

if_dump_vty() calls => hook_call(zebra_if_extra_info, vty, ifp);

if_dump_vty_json() now do the same call, with additional parameter:
hook_call(zebra_if_extra_info, vty, json_if, ifp);

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2025-03-17 11:19:58 +01:00
Dmytro Shytyi 942a7c916c
bgpd: align peer_unconfigure with gracefull-restart
When configured Graceful-Restart, skipping unconfig notification,
similarly as it is done in 95098d9611
("bgpd: Do not send Deconfig/Shutdown message when restarting")

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2025-03-17 11:19:58 +01:00
Philippe Guibert 496caed836
bgpd: fix radv interface disabled when bgp instance removed
If a peer uses radv for an interface, and bgp instance is removed,
then the radv service is not disabled on the interface.

Fix this by doing the same at BGP unconfiguration. Like it has been
done when a peer is unconfigured, call the radv unregistration before
deleting the peer.

Fixes: b3a3290e23 ("bgpd: turn off RAs when numbered peers are deleted")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2025-03-17 11:19:58 +01:00
echken aabe3c2079 fix(vrrp): display vrrp version by default
Make the VRRP version information always visible in the running
configuration output, regardless of whether it's the default value
(version 3) or not.

When using frr-reload.py to apply configuration changes, VRRP instances
were being unnecessarily reinitialized even when no actual configuration
changes were made. This occurred because:
The cli_show_vrrp function in vrrpd/vrrp_vty.c does not display the VRRP
version in the show running-config output when it's the default value
(version 3).
Configuration files often explicitly specify vrrp X version 3 even
though it's the default.
When frr-reload.py compares the explicit configuration with the running
configuration, it detects a difference and generates commands to remove
and recreate the VRRP instance.

This patch modifies the cli_show_vrrp function to unconditionally
display the VRRP version, regardless of whether it's the default value
or the show_defaults parameter is set. By making the version information
explicit in all cases, we ensure consistent configuration comparison in
frr-reload.py, preventing unnecessary VRRP reinitialization and
associated network disruptions.

Signed-off-by: echken <chengcheng.luo@smartx.com>
2025-03-17 03:46:26 +00:00
Donatas Abraitis c288e5fbaf
Merge pull request #18399 from LabNConsulting/chopps/fix-unit-tests
2 unit-test fixes
2025-03-16 15:14:55 +01:00
Donatas Abraitis f2245941d8
Merge pull request #18384 from LabNConsulting/chopps/suppress-expected-libyang-error-log
lib: suppress libyang logs during expected error result
2025-03-16 15:12:59 +01:00
Donatas Abraitis f5a74fc91c
Merge pull request #18387 from Manpreet-k0/redo_import_check_crash
bgpd: Fixed crash upon bgp network import-check command
2025-03-15 18:35:04 +01:00
Donatas Abraitis 35cc716363
Merge pull request #18394 from donaldsharp/fpm_listener_output
zebra: add ability to specify output file with fpm_listener
2025-03-15 18:32:19 +01:00
Donatas Abraitis 0647a115cc
Merge pull request #18395 from donaldsharp/bgp_stream_copy_usage_removal
bgpd: Remove unnecessary stream_new/stream_copies in bgp_open_make
2025-03-15 18:31:41 +01:00
Donatas Abraitis 7444121f79
Merge pull request #18393 from LabNConsulting/aceelindem/ospf6-area-no-config-delete-stale
ospf6d: Disable and delete OSPFv3 areas that no longer have interfaces or configuration.
2025-03-15 14:15:58 +01:00
Christian Hopps bc3f7d9c07 tests: fix wrong callback function parameters in unit-test
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-03-15 04:12:31 +00:00
Christian Hopps 986501029e tests: deal with configure overridden timestamp prec in unit test
Previously if you configured a different timestamp precision then
`make check` would fail as the non-default config is generated and
fails test_cli config file comparison.

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-03-15 04:11:48 +00:00
Donald Sharp c9655e2893 bgpd: Remove unnecessary stream_new/stream_copies in bgp_open_make
The call into bgp_open_capability can return that it wrote more
than BGP_OPEN_NON_EXT_OPT_LEN bytes, in that case the open
part needs to be written again with ext_opt_params set to
true to allow extended parameters to be written thus keeping
the len < 255 bytes.  The code to do this was first creating
a new stream and then copying into it the stream, trying
to call bgp_open_capability() and if it succeeded recopying
the tmp stream back onto the original.

Let's change this around such that we save the current spot
in the stream of where we are writing and if the change does
not work reset the pointer and try again with the correct
parameter.  This removes the stream and multiple copies and
eventual free of the temporary stream.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-03-14 14:50:59 -04:00
Donald Sharp f0b2bc3b4c zebra: add ability to specify output file with fpm_listener
The fpm_listener didn't have the ability to specify the output
file location at all.  Modify the code to accept this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-03-14 13:24:19 -04:00
Acee Lindem 04994891fe ospf6d: Disable and delete OSPFv3 areas that no longer have interfaces or configuration.
This fix will delete an OSPFv3 area when all the interfaces and
        configuration (ranges, NSSA ranges, stub area, NSSA area, filter-list,
        import-list and export-list) have been removed. The changes provides
        a general solution to https://github.com/FRRouting/frr/issues/18324.

Signed-off-by: Acee Lindem <acee@lindem.com>
2025-03-14 16:02:28 +00:00
Jafar Al-Gharaibeh 7945af0200
Merge pull request #18360 from raja-rajasekar/rajasekarr/fix_explicit_sid_allocation
zebra: ensure proper return for failure for Sid allocation
2025-03-14 09:57:41 -05:00
Christian Hopps 4663c3ef82 lib: suppress libyang logs during expected error result.
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-03-14 14:36:13 +00:00
Christian Hopps 48ceff2128 lib: northbound: also log debugs for new get callback
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-03-14 14:36:13 +00:00
Donald Sharp dbecefb6c6
Merge pull request #18383 from LabNConsulting/chopps/fix-oper-state-list-query-bug
Fix bug with oper-state queries including list node
2025-03-14 10:33:16 -04:00
Donald Sharp e5848deedf
Merge pull request #18377 from kaffarell/master
isisd: fix bit flag collision in options field
2025-03-14 09:43:09 -04:00
Donald Sharp e7318ce845
Merge pull request #18388 from y-bharath14/srib-yang-v5
yang: Fixed pyang errors at frr-bgp-common.yang
2025-03-14 09:41:39 -04:00
Manpreet Kaur bc1008b970 bgpd: Fixed crash upon bgp network import-check command
BT:
```
3  <signal handler called>
4  0x00005616837546fc in bgp_static_update (bgp=bgp@entry=0x5616865eac50, p=0x561686639e40,
    bgp_static=0x561686639f50, afi=afi@entry=AFI_IP6, safi=safi@entry=SAFI_UNICAST) at ../bgpd/bgp_route.c:7232
5  0x0000561683754ad0 in bgp_static_add (bgp=0x5616865eac50) at ../bgpd/bgp_table.h:413
6  0x0000561683785e2e in no_bgp_network_import_check (self=<optimized out>, vty=0x5616865e04c0,
    argc=<optimized out>, argv=<optimized out>) at ../bgpd/bgp_vty.c:4609
7  0x00007fdbcc294820 in cmd_execute_command_real (vline=vline@entry=0x561686663000,
```

The program encountered a SEG FAULT when attempting to access pi->extra->vrfleak->bgp_orig because
pi->extra->vrfleak was NULL.
```
(gdb) p pi->extra->vrfleak
$1 = (struct bgp_path_info_extra_vrfleak *) 0x0
(gdb) p pi->extra->vrfleak->bgp_orig
Cannot access memory at address 0x8
```
Added NOT NULL check on pi->extra->vrfleak before accessing pi->extra->vrfleak->bgp_orig
to prevent the segmentation fault.

Signed-off-by: Manpreet Kaur <manpreetk@nvidia.com>
2025-03-14 05:40:16 -07:00
Y Bharath d7839f5ddd yang: Fixed pyang errors at frr-bgp-common.yang
Fixed pyang errors at frr-bgp-common.yang

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-03-14 14:31:52 +05:30
Christian Hopps 2586c4c3ed lib: make sure we update the darr_strlen from pruned string.
This fixes a bug when handling of queries which include list nodes in
the xpath.

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-03-14 08:37:46 +00:00
Christian Hopps d58a8f473b lib: add darr_strlen_fixup() to update len based on NUL term
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-03-14 08:37:46 +00:00
Donatas Abraitis 8982a81de1
Merge pull request #18380 from donaldsharp/non_peer_group
bgpd: Show bgp <afi> <safi> shouldn't display peers in groups
2025-03-14 07:30:52 +01:00
Donald Sharp 3fb72a03c3 bgpd: Show bgp <afi> <safi> shouldn't display peers in groups
The command `show bgp <afi> <safi>` has this output:

r1# show bgp ipv4 uni 10.0.0.0
BGP routing table entry for 10.0.0.0/32, version 1
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  r1-eth0 r1-eth1 r1-eth2 r1-eth3
  ....

It specifically states `Advertised to non peer-group peers:` yet
the code is not filtering those out.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-03-13 15:19:02 -04:00
Gabriel Goller 86faed512f isisd: fix bit flag collision in options field
Resolve conflict between F_ISIS_UNIT_TEST and ISIS_OPT_DUMMY_AS_LOOPBACK
which were both using the same bit value (0x01). This collision caused
unit test mode to be unintentionally enabled when DUMMY_AS_LOOPBACK was set.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2025-03-13 16:51:04 +01:00