Commit Graph

38268 Commits

Author SHA1 Message Date
Donald Sharp
f94ad538cf bgpd: Ensure ibuf count is protected by mutex
Grab the count of streams in ibuf when it is protected
by a mutex.  Since this data is written to it in another
pthread.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-17 10:16:48 -05:00
Donald Sharp
4b96752737 zebra: Add some documentation on when zserv_open should be used
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-17 10:16:48 -05:00
Donald Sharp
283cc51178 ospfd: Fix Coverity SA #1617470, 76 and 78
msg_new takes a uint16_t, the length passed
down variable is a unsigned int, thus 32 bit.
It's possible, but highly unlikely, that the
msglen could be greater than 16 bit.
Let's just add some checks to ensure that
this could not happen.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-17 10:16:48 -05:00
Donatas Abraitis
db853cc97e bgpd: Implement Link-Local Next Hop capability
Related: https://datatracker.ietf.org/doc/html/draft-white-linklocal-capability

TL;DR; use 16 bytes long next-hops for point-to-point (unnumbered) links instead
of sending 32 bytes (::/LL, GUA/LL, LL/LL combinations).

For backward compatiblity we should handle even 32 bytes existing next hops.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-17 16:48:32 +02:00
Donatas Abraitis
d3c46bce3b bgpd: Set the last reset reason correctly if we change capabilities per-peer
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-17 13:22:38 +02:00
Donatas Abraitis
8878e385d8 tests: Check if Link-Local Next Hop capability works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-17 13:15:19 +02:00
Donatas Abraitis
474cd4b664 doc: Add Link-Local Next Hop capability configuration knobs
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-17 13:15:19 +02:00
Donatas Abraitis
675666cbaf bgpd: Show the MP nexthop length in JSON output
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-17 13:15:19 +02:00
Donatas Abraitis
705e6f881b
Merge pull request #17836 from pguibert6WIND/limit_comm_list_count
limit community list count
2025-01-17 12:44:24 +02:00
Donald Sharp
acc3cfe334
Merge pull request #17727 from idryzhov/netns-all-daemons
lib: introduce global -w option for VRF netns backend
2025-01-16 08:11:07 -05:00
Donatas Abraitis
4e363bd48d
Merge pull request #17862 from LabNConsulting/chopps/ldp-snmp-fix
ldp snmp/grpc test fix
2025-01-16 09:11:25 +02:00
Donatas Abraitis
2df722262f bgpd: Check if the peer really exists before sending dynamic capability
CID: 1617727

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-16 09:06:17 +02:00
Julian Klaiber
f1a1703a0a tools: Allow deleting of interfaces
The frr-reload script currently deletes configurations
line-by-line under an interface context, if the interface was removed.
This approach fails when the interface has already been removed from the system.

This change enables whole interface removal using a single command
(no interface <interface-name>), simplifying the reload process and
reducing reload errors.

Signed-off-by: Julian Klaiber <jklaiber@open-systems.com>
2025-01-16 07:04:15 +01:00
Christian Hopps
f71d5281ce tests: dont run ldp snmp test if no snmp
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-16 02:13:34 +00:00
Christian Hopps
b0f9c4d688 tests: fix missed grpc test requirement for frr-backend addition
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-16 02:13:34 +00:00
Igor Ryzhov
754b949889 tests: use global -w option instead of per-daemon -n
Add ability to enable -w option for all daemons in a topotest and use
this option instead of the deprecated -n.

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2025-01-15 23:38:27 +02:00
Igor Ryzhov
300f8dbda4 lib: introduce global -w option for VRF netns backend
Current -n option is only for zebra and mgmtd. All other daemons receive
the VRF backend configuration from zebra upon connection to it. This
leads to a potential race condition - daemons need to know the backend
before they start reading their config, but they can be not connected to
zebra yet at this point. As the VRF backend cannot change during runtime,
let's introduce a new global -w option for setting netns backend, to
make sure that all daemons know their VRF backend immediately after
start.

The reason for introducing a new option instead of making -n global is
that ospfd already uses -n for another purposes.

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2025-01-15 23:38:27 +02:00
Igor Ryzhov
6f214d97d1 lib, zebra: move ns context intialization to zebra
vrf->ns_ctxt is only ever used in zebra, so move its initialization to
zebra's callback. Ideally this pointer shouldn't even be a part of
library's vrf struct, and moved to zebra-specific struct, but this is
the first step.

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2025-01-15 23:38:27 +02:00
Igor Ryzhov
4877f2f685 lib: remove VRF_BACKEND_UNKNOWN
The backend type cannot be unknown. It is configured to VRF_LITE by
default in zebra anyway, so just init to VRF_LITE in the lib and remove
the UNKNOWN type.

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2025-01-15 23:38:27 +02:00
Russ White
0bc373c573
Merge pull request #17838 from opensourcerouting/msdp-topo3
topotests: improve test reliability
2025-01-15 11:11:49 -05:00
Russ White
66a5d76920
Merge pull request #17810 from donaldsharp/bgp_connect_refactor
Bgp connect refactor
2025-01-15 11:11:41 -05:00
Donald Sharp
d43bdb9568
Merge pull request #17855 from opensourcerouting/fix/bgp_enhe_capability_via_dynamic_capability
bgpd: Handle ENHE capability via dynamic capability
2025-01-15 10:34:39 -05:00
Donald Sharp
953d5fd526
Merge pull request #17799 from LabNConsulting/chopps/backend-yang-model
mgmtd backend yang model (depends on #17796)
2025-01-15 10:22:11 -05:00
Donald Sharp
5867c32161
Merge pull request #17776 from nabahr/group-rpf-mode
PIMD: RPF lookup mode per-group, per-source
2025-01-15 10:20:24 -05:00
Donatas Abraitis
5e41d30b44
Merge pull request #17854 from enkechen-panw/flag-reflected
bgpd: remove unused BATTR_REFLECTED for rmap_change_flags
2025-01-15 15:41:17 +02:00
Donatas Abraitis
93ea9748cf
Merge pull request #17859 from donaldsharp/active_routes_are_active
Active routes are active
2025-01-15 15:01:59 +02:00
Donald Sharp
e9bd124149
Merge pull request #17858 from enkechen-panw/aggr-fix5
bgpd: move bgp_aggregate_increment() after bgp_path_info_add()
2025-01-15 07:37:12 -05:00
Donald Sharp
ec6a000b0b zebra: On Nexthop install failure don't set Installation failed
Currently FRR when installing a nexthop group, the installation can fail.
The assumption with the code was that the current nexthop group was
not already installed.  This leaves a problem state where if the
users of the nexthop group are removed, the nexthop group will be
removed possibly leaving a orphaned nexthop group in the data plane.

FRR on a nexthop group installation does not actually know the status
of the nexthop group in the kernel.  It's possible that a earlier
version of the nexthop group is left in play.  It's possible that
there is no nexthop group in the kernel at all.  Leaving the
Installed flag alone allows upon Zebra removing the nexthop
group when it is removed from zebra.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-14 16:23:40 -05:00
Donatas Abraitis
d60320c6d2 bgpd: Handle ENHE capability via dynamic capability
FRR supports dynamic capability which is useful to exchange the capabilities
without tearing down the session. ENHE capability was missed to be included
handling via dynamic capability. Let's add it too.

This was missed and asked in Slack that it would be useful.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-14 22:46:53 +02:00
Donatas Abraitis
d1cfd73060 tests: Check if ENHE capability can be handled dynamically
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-14 22:46:51 +02:00
Donald Sharp
b61424a717 zebra: Nexthops need to be ACTIVE in some cases
Currently if you have an interface down event, Zebra
sets the nexthop(s) as !ACTIVE that use it.  On
interface up events the singleton nexthops are not being
set as ACTIVE.  Due to timing events it is sometimes
possible to end up with a route that is using a singleton

Change singleton nexthops to set the nexthop to ACTIVE.
This will allow the nexthop to be reinstalled appropriately
as well.

I was able to easily reproduce this using sharpd since
it does not attempt to reinstall the routes when a interface
goes up/down.

Before:

D>* 10.0.0.0/32 [150/0] via 192.168.102.34, dummy2, weight 1, 00:00:01

sharpd@eva ~/frr5 (master)> sudo ip link set dummy2 down ; sudo ip link set dummy2 up

D>  10.0.0.0/32 [150/0] (350) via 192.168.102.34, dummy2 inactive, weight 1, 00:00:10

After code change:

D>* 10.0.0.0/32 [150/0] (73) via 192.168.102.34, dummy2, weight 1, 00:00:14

sharpd@eva ~/frr5 (master)> sudo ip link set dummy2 down ; sudo ip link set dummy2 up

D>* 10.0.0.0/32 [150/0] (73) via 192.168.102.34, dummy2, weight 1, 00:00:21

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-14 15:12:32 -05:00
Christian Hopps
5f2a927d7b lib: northbound/mgmtd: add backend model support
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-14 18:48:59 +00:00
Donald Sharp
5f35096123
Merge pull request #17796 from LabNConsulting/chopps/datastore-notifications
operational-state (datastore) change notifications
2025-01-14 13:47:28 -05:00
Donald Sharp
67da971218
Merge pull request #17581 from mjstapp/fix_fpm_netlink
zebra: avoid race between FPM pthread and zebra main pthread in netlink encode/decode
2025-01-14 13:42:29 -05:00
Enke Chen
c467af10b2 bgpd: move bgp_aggregate_increment() after bgp_path_info_add()
Route aggregation should be checked after a route is added, and
not before. This is for code flow and consistency.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-01-14 10:29:22 -08:00
Donald Sharp
a6595fde70
Merge pull request #17850 from Jafaral/wr-rpg
pimd: always write cand-rp group config even when rp is inactive
2025-01-14 12:41:15 -05:00
Donald Sharp
1c6cd0009d
Merge pull request #17841 from Jafaral/pim-bsr-rp
pimd: fix BSR RPs timing out
2025-01-14 12:39:52 -05:00
Enke Chen
96ba273e4e bgpd: remove unused BATTR_REFLECTED for rmap_change_flags
Remove unused BATTR_REFLECTED for rmap_change_flags.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-01-14 08:46:54 -08:00
Russ White
4212bac7de
Merge pull request #17800 from opensourcerouting/fix/import_between_vrf_respect_allowas_in
bgpd: Respect allowas-in value from the source VRF's peer
2025-01-14 10:19:26 -05:00
Russ White
d982b1c785
Merge pull request #17803 from anlancs/ospfd/fix-redundant-timers
ospfd: avoid the redundant timers
2025-01-14 10:17:20 -05:00
Russ White
fbea5acc0b
Merge pull request #17806 from opensourcerouting/fix/lua5.4_support
Lua 5.4 support
2025-01-14 10:09:04 -05:00
Russ White
5e881db496
Merge pull request #17837 from enkechen-panw/aggr-fix4
bgpd: fix churn of aggregate routes from duplicate config
2025-01-14 10:05:06 -05:00
Donald Sharp
840b729b6b
Merge pull request #17842 from enkechen-panw/aggr-safi
bgpd: remove unused safi in bgp_aggregate structure
2025-01-14 09:37:39 -05:00
Donald Sharp
ef4b28682b
Merge pull request #17846 from Jafaral/fix-latex-warn
doc: fix LaTex warnings, add documentation to build docs
2025-01-14 09:37:09 -05:00
Russ White
b4619da938
Merge pull request #17639 from pguibert6WIND/bmp_import_vrf_view
Ability to import BMP information from a separate BGP instance
2025-01-14 08:38:37 -05:00
Philippe Guibert
bd4b8c3dac topotest: add a test to control the community-list count
Add a test to control the community-list count.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-01-14 13:59:45 +01:00
Philippe Guibert
f19b8668b3 bgpd: add 'match community-count' command to restrict comm count
Add a mechanism in route-map to filter out route-map which have a list
of communities greater than the given number.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-01-14 13:59:42 +01:00
Donatas Abraitis
ba4122d6db
Merge pull request #17840 from Jafaral/pim-acl-test
tests: remove unnecessary wildcard fields from pim acl test
2025-01-14 09:08:41 +02:00
Donatas Abraitis
1e1c70faac
Merge pull request #17847 from chiragshah6/freloadfix
tools: fix frr-reload for nbr deletion of no form cmds
2025-01-14 09:07:14 +02:00
Jafar Al-Gharaibeh
8e66f821bf pimd: always write cand-rp group config even when rp is inactive
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13 23:34:08 -06:00