]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
14 months agoMerge pull request #15366 from cscarpitta/feature/srv6-fpm-pb-extension
Russ White [Tue, 20 Feb 2024 15:14:56 +0000 (10:14 -0500)]
Merge pull request #15366 from cscarpitta/feature/srv6-fpm-pb-extension

fpm: Add support for SRv6 to FPM protobuf

14 months agoMerge pull request #15351 from louis-6wind/fix-leak-vrf-interface
Russ White [Tue, 20 Feb 2024 15:14:20 +0000 (10:14 -0500)]
Merge pull request #15351 from louis-6wind/fix-leak-vrf-interface

bgpd: update route leak after vrf interface changes

14 months agoMerge pull request #15394 from sri-mohan1/srib-24-babel
Donald Sharp [Tue, 20 Feb 2024 12:02:59 +0000 (07:02 -0500)]
Merge pull request #15394 from sri-mohan1/srib-24-babel

babeld: changes for code maintainability

14 months agobabeld: changes for code maintainability 15394/head
sri-mohan1 [Mon, 19 Feb 2024 18:32:50 +0000 (00:02 +0530)]
babeld: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agoMerge pull request #15381 from LabNConsulting/chopps/nb-notif
Igor Ryzhov [Mon, 19 Feb 2024 14:52:47 +0000 (16:52 +0200)]
Merge pull request #15381 from LabNConsulting/chopps/nb-notif

lib: mgmtd: add xpath arg to YANG notification message

14 months agoMerge pull request #15389 from opensourcerouting/fix/add_mgmtd_pytest_marker
Christian Hopps [Mon, 19 Feb 2024 11:36:15 +0000 (06:36 -0500)]
Merge pull request #15389 from opensourcerouting/fix/add_mgmtd_pytest_marker

doc: Add `mgmtd` pytest marker into documentation

14 months agolib: mgmtd: add xpath arg to notification message 15381/head
Christian Hopps [Wed, 14 Feb 2024 15:04:11 +0000 (10:04 -0500)]
lib: mgmtd: add xpath arg to notification message

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agofpm: Add func to encode SRv6 SIDs in protobuf 15366/head
Carmine Scarpitta [Tue, 13 Feb 2024 10:48:11 +0000 (11:48 +0100)]
fpm: Add func to encode SRv6 SIDs in protobuf

Add a bunch of helper functions to support encoding of SRv6 SIDs in
protobuf.

Specifically,
* `fpm_srv6_sid_format_create`: encode SID format information into a
protobuf `SRv6SIDFormat` structure
* `fpm_srv6_local_sid_*_behavior_create` functions: encode an SRv6 SID
behavior and associated attributes into a protobuf
`Fpm__SRv6LocalSID__*` structure

This is a preliminary commit to support sending SRv6 Local SIDs and VPN
SIDs via protobuf.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
14 months agofpm: Add functions to encode nexthop in protobuf
Carmine Scarpitta [Tue, 13 Feb 2024 10:40:49 +0000 (11:40 +0100)]
fpm: Add functions to encode nexthop in protobuf

Add two helper functions to encode/decode nexthops in protobuf.

Specifically,
* `fpm_nexthop_create`: encode a `struct nexthop` in a protobuf nexthop
structure
* `fpm_nexthop_get`: decode a nexthop protobuf structure into a `struct
nexthop`

This is a preliminary commit to support sending SRv6 Local SIDs and VPN
SIDs via protobuf.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
14 months agofpm: Add SRv6 VPN SIDs to `fpm.proto`
Carmine Scarpitta [Tue, 13 Feb 2024 11:12:34 +0000 (12:12 +0100)]
fpm: Add SRv6 VPN SIDs to `fpm.proto`

Add two optional fields to the AddRoute protobuf message to support
SRv6 VPN use cases:
* `srv6_vpn_sid`: used to associate an SRv6 VPN SID to a route; if
present, the router will steer the traffic that matches the prefix by
encapsulating the payload in an outer IPv6 header where the destination
address is the SRv6 VPN SID provided
* `srv6_encap_source_address`: source Address of outer encapsulating
IPv6 header

This is a preliminary commit to support sending SRv6 Local SIDs and VPN
SIDs via protobuf.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
14 months agofpm: Add SRv6 Local SIDs to `fpm.proto`
Carmine Scarpitta [Tue, 13 Feb 2024 09:29:34 +0000 (10:29 +0100)]
fpm: Add SRv6 Local SIDs to `fpm.proto`

Add several protobuf messages to support the installation and removal
of SRv6 Local SIDs via FPM protobuf.

This is a preliminary commit to support sending SRv6 Local SIDs and VPN
SIDs via protobuf.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
14 months agoMerge pull request #15357 from dpward/master
Donatas Abraitis [Sun, 18 Feb 2024 12:43:21 +0000 (14:43 +0200)]
Merge pull request #15357 from dpward/master

github: Replace issue template with issue form

14 months agodoc: Add `mgmtd` pytest marker into documentation 15389/head
Donatas Abraitis [Sat, 17 Feb 2024 09:24:29 +0000 (11:24 +0200)]
doc: Add `mgmtd` pytest marker into documentation

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #15376 from sri-mohan1/srib-24-babel
Donatas Abraitis [Fri, 16 Feb 2024 20:29:06 +0000 (22:29 +0200)]
Merge pull request #15376 from sri-mohan1/srib-24-babel

babeld: changes for code maintainability

14 months agoMerge pull request #15378 from idryzhov/ospf-suppress-fa
Donald Sharp [Fri, 16 Feb 2024 12:26:24 +0000 (07:26 -0500)]
Merge pull request #15378 from idryzhov/ospf-suppress-fa

tests: fix ospf_suppress_fa timing issue

14 months agoMerge pull request #15382 from donaldsharp/more_sa_failures
Igor Ryzhov [Fri, 16 Feb 2024 11:55:35 +0000 (13:55 +0200)]
Merge pull request #15382 from donaldsharp/more_sa_failures

More sa failures

14 months agobgpd: Fix value stored to group never being read 15382/head
Donald Sharp [Fri, 16 Feb 2024 04:28:18 +0000 (23:28 -0500)]
bgpd: Fix value stored to group never being read

SA Reports:

bgpd/bgp_rpki.c:1085:24: warning: Value stored to 'group' during its initialization is never read [deadcode.DeadStores]
        struct rtr_mgr_group *group = get_connected_group(rpki_vrf);
                              ^~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoospfd: Fix assignment with never being used
Donald Sharp [Fri, 16 Feb 2024 04:27:38 +0000 (23:27 -0500)]
ospfd: Fix assignment with never being used

SA finds this:

error 14-Feb-2024 14:52:24 ospfd/ospf_te.c:3962:2: warning: Value stored to 'sub' is never read [deadcode.DeadStores]
error 14-Feb-2024 14:52:24         sub = 0;
error 14-Feb-2024 14:52:24         ^     ~
error 14-Feb-2024 14:52:24 1 warning generated.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agolib: always call new notification hooks too
Christian Hopps [Mon, 12 Feb 2024 18:03:32 +0000 (13:03 -0500)]
lib: always call new notification hooks too

- call the new notification hooks when backends call the old notification
posting API.

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agoMerge pull request #15371 from LabNConsulting/chopps/mgmtd-fixes
Igor Ryzhov [Thu, 15 Feb 2024 18:02:23 +0000 (20:02 +0200)]
Merge pull request #15371 from LabNConsulting/chopps/mgmtd-fixes

Fixes for the northbound/mgmtd

14 months agotests: fix ospf_suppress_fa timing issue 15378/head
Igor Ryzhov [Thu, 15 Feb 2024 13:35:24 +0000 (15:35 +0200)]
tests: fix ospf_suppress_fa timing issue

Set static router-id for OSPF, because otherwise it depends on timing of
router-id updates received from zebra and may differ between test runs.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agolib: actually create the tree for the conversion 15371/head
Christian Hopps [Wed, 14 Feb 2024 22:32:04 +0000 (17:32 -0500)]
lib: actually create the tree for the conversion

Before this fix would always return empty results b/c there was no
libyang tree to print to output format.

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agolib: fix memleak on success
Christian Hopps [Wed, 14 Feb 2024 22:31:12 +0000 (17:31 -0500)]
lib: fix memleak on success

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agogithub: Replace issue template with issue form 15357/head
David Ward [Mon, 12 Feb 2024 11:30:26 +0000 (06:30 -0500)]
github: Replace issue template with issue form

Signed-off-by: David Ward <david.ward@gatech.edu>
14 months agotests: check route leak update after vrf creation and deletion 15351/head
Louis Scalbert [Fri, 9 Feb 2024 15:28:18 +0000 (16:28 +0100)]
tests: check route leak update after vrf creation and deletion

Ensure that a locally leaked route is updated after a VRF (dis)appears.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agobgpd: update route leak when vrf appears
Louis Scalbert [Fri, 9 Feb 2024 15:28:23 +0000 (16:28 +0100)]
bgpd: update route leak when vrf appears

If the VRF is not yet created and a BGP instance is created for the
VRF, dependent leaked routes are inactive, which is normal. However,
when the VRF interface appears, they remains inactive.

Update route leak when a VRF interface appears. Note that routes to a
deleted VRF are already removed by zebra.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: check route leak after changing vrf state
Louis Scalbert [Fri, 9 Feb 2024 14:47:40 +0000 (15:47 +0100)]
tests: check route leak after changing vrf state

Check that local route leaks are set to "inactive" when the VRF
interface is shutdown and, conversely, that they are set to "active"
when the VRF interface is unshut.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agobgpd: update route leak when vrf state changes
Louis Scalbert [Tue, 26 Apr 2022 14:57:45 +0000 (16:57 +0200)]
bgpd: update route leak when vrf state changes

Locally leaked routes remain active after the nexthop VRF interface goes
down.

Update route leaking when the loopback or a VRF interface state change is
received from zebra.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: use check_ping in bgp_vrf_route_leak_basic
Louis Scalbert [Wed, 14 Feb 2024 15:35:51 +0000 (16:35 +0100)]
tests: use check_ping in bgp_vrf_route_leak_basic

Use check_ping in bgp_vrf_route_leak_basic

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: add source_addr in check_ping
Louis Scalbert [Wed, 14 Feb 2024 15:32:13 +0000 (16:32 +0100)]
tests: add source_addr in check_ping

Allow specifying a source_addr in check_ping library function.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: fix duplicates in bgp_vrf_route_leak_basic
Louis Scalbert [Fri, 9 Feb 2024 14:55:47 +0000 (15:55 +0100)]
tests: fix duplicates in bgp_vrf_route_leak_basic

Test functions were duplicated by mistakes. They were identical.

Fixes: 8af61c8a34 ("topotests: test leak from the default vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agoMerge pull request #15332 from donaldsharp/nhg_stuffs
Donatas Abraitis [Wed, 14 Feb 2024 14:14:19 +0000 (16:14 +0200)]
Merge pull request #15332 from donaldsharp/nhg_stuffs

Nhg stuffs

14 months agoMerge pull request #15288 from donaldsharp/shell_access_removal
Donatas Abraitis [Wed, 14 Feb 2024 09:20:36 +0000 (11:20 +0200)]
Merge pull request #15288 from donaldsharp/shell_access_removal

vtysh: Remove deprecated shell_access code

14 months agoMerge pull request #15359 from LabNConsulting/chopps/reap-unused-phase
Igor Ryzhov [Wed, 14 Feb 2024 09:15:06 +0000 (11:15 +0200)]
Merge pull request #15359 from LabNConsulting/chopps/reap-unused-phase

mgmtd: remove unused commit phase SEND_CFG

14 months agobuild: FRR 10.1 development version frr-10.0-dev
Donatas Abraitis [Tue, 13 Feb 2024 19:18:45 +0000 (21:18 +0200)]
build: FRR 10.1 development version

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobabeld: changes for code maintainability 15376/head
sri-mohan1 [Tue, 13 Feb 2024 18:30:31 +0000 (00:00 +0530)]
babeld: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agoMerge pull request #15234 from opensourcerouting/snmp-topotest-fixes base_10.0
Donald Sharp [Tue, 13 Feb 2024 15:59:30 +0000 (10:59 -0500)]
Merge pull request #15234 from opensourcerouting/snmp-topotest-fixes

topotests: fix snmptrap log OID parsing

14 months agoMerge pull request #15320 from donaldsharp/vtysh_limit_fds
Russ White [Tue, 13 Feb 2024 14:50:00 +0000 (09:50 -0500)]
Merge pull request #15320 from donaldsharp/vtysh_limit_fds

lib, ospfclient, vtysh: Allow for a minimum fd poll size

14 months agoMerge pull request #15284 from opensourcerouting/feature/bgpd_announce_rpki_state_knob
Russ White [Tue, 13 Feb 2024 14:35:10 +0000 (09:35 -0500)]
Merge pull request #15284 from opensourcerouting/feature/bgpd_announce_rpki_state_knob

bgpd: Add neighbor X send-community extended rpki command

14 months agoMerge pull request #15042 from Orange-OpenSource/ospf-te
Christian Hopps [Tue, 13 Feb 2024 10:37:29 +0000 (05:37 -0500)]
Merge pull request #15042 from Orange-OpenSource/ospf-te

ospfd: Add Opaque LSA decoder for json output

14 months agoMerge pull request #15361 from idryzhov/fix-be-interested
Christian Hopps [Tue, 13 Feb 2024 01:11:20 +0000 (20:11 -0500)]
Merge pull request #15361 from idryzhov/fix-be-interested

mgmtd: fix be_is_client_interested

14 months agoMerge pull request #15352 from louis-6wind/fix-leak-recursive
Donatas Abraitis [Mon, 12 Feb 2024 19:42:03 +0000 (21:42 +0200)]
Merge pull request #15352 from louis-6wind/fix-leak-recursive

bgpd: fix route recursion on leaked routes

14 months agomgmtd: fix be_is_client_interested 15361/head
Igor Ryzhov [Mon, 12 Feb 2024 18:34:33 +0000 (20:34 +0200)]
mgmtd: fix be_is_client_interested

Backend "subscribe" API allows daemons to dynamically register xpaths
they are interested in. Such xpaths are not stored in hardcoded
config/oper xpath arrays so this function fails to understand that a
backend daemon is interested in them. Fix by using dynamic xpath maps
instead which store both hardcoded and dynamic xpaths.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15358 from LabNConsulting/chopps/doc-update
Igor Ryzhov [Mon, 12 Feb 2024 17:52:35 +0000 (19:52 +0200)]
Merge pull request #15358 from LabNConsulting/chopps/doc-update

update doc with new more strict protobuf requirements

14 months agotests: adapt ospfapiclient test to new json output 15042/head
Olivier Dugeon [Thu, 21 Dec 2023 21:12:59 +0000 (22:12 +0100)]
tests: adapt ospfapiclient test to new json output

Following new json decoder for Opaque LSA, this patch adapts the ospfapiclient
test to the new json output.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agoospfd: Decode Extended Link & Prefix TLVs for json
Olivier Dugeon [Tue, 19 Dec 2023 15:00:25 +0000 (16:00 +0100)]
ospfd: Decode Extended Link & Prefix TLVs for json

When dumping ospf database with json output, decode Extended Link and Extended
Prefix TLVs and sub-TLVs.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agoospfd: Decode Router Info. TLVs for json output
Olivier Dugeon [Tue, 19 Dec 2023 14:59:33 +0000 (15:59 +0100)]
ospfd: Decode Router Info. TLVs for json output

When dumping ospf database with json output, decode Router Information TLVs
and sub-TLVs.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agoospfd: Decode TE TLVs for json output
Olivier Dugeon [Tue, 19 Dec 2023 14:57:49 +0000 (15:57 +0100)]
ospfd: Decode TE TLVs for json output

When dumping ospf database with json output, decode Traffic Engineering TLVs
and sub-TLVs.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agoospfd: Prepare Opaque LSA for json output
Olivier Dugeon [Tue, 19 Dec 2023 14:56:12 +0000 (15:56 +0100)]
ospfd: Prepare Opaque LSA for json output

Instead of output bulk of data with json output, prepare json context to decode
opaque TLVs and sub-TLVs.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agomgmtd: remove unused commit phase SEND_CFG 15359/head
Christian Hopps [Thu, 8 Feb 2024 15:30:42 +0000 (10:30 -0500)]
mgmtd: remove unused commit phase SEND_CFG

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agotests: fix grpc test 15358/head
Christian Hopps [Mon, 12 Feb 2024 12:48:50 +0000 (07:48 -0500)]
tests: fix grpc test

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agodoc: docker: update with new more strict protobuf requirements
Christian Hopps [Mon, 12 Feb 2024 11:48:12 +0000 (06:48 -0500)]
doc: docker: update with new more strict protobuf requirements

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agoMerge pull request #15355 from idryzhov/fix-mgmtd-notif
Christian Hopps [Mon, 12 Feb 2024 11:17:38 +0000 (06:17 -0500)]
Merge pull request #15355 from idryzhov/fix-mgmtd-notif

Fix and rework YANG notifications

14 months agoMerge pull request #15346 from opensourcerouting/fix/memory_optimizations
Donald Sharp [Mon, 12 Feb 2024 02:33:44 +0000 (21:33 -0500)]
Merge pull request #15346 from opensourcerouting/fix/memory_optimizations

Some more memory optimizations

14 months agoMerge pull request #15356 from idryzhov/configure-sysconfdir
Donald Sharp [Mon, 12 Feb 2024 02:33:00 +0000 (21:33 -0500)]
Merge pull request #15356 from idryzhov/configure-sysconfdir

build: fix configure output

14 months agoMerge pull request #15347 from askorichenko/test-bgp-ttl
Donatas Abraitis [Sun, 11 Feb 2024 20:12:32 +0000 (22:12 +0200)]
Merge pull request #15347 from askorichenko/test-bgp-ttl

bgpd: fix minttl copying during peer reset

14 months agobuild: fix configure output 15356/head
Igor Ryzhov [Sat, 10 Feb 2024 22:53:06 +0000 (00:53 +0200)]
build: fix configure output

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agolib, mgmtd: rework processing of yang notifications 15355/head
Igor Ryzhov [Sat, 10 Feb 2024 00:11:13 +0000 (02:11 +0200)]
lib, mgmtd: rework processing of yang notifications

Currently, YANG notification processing is done using a special type of
callbacks registered in backend clients. In this commit, we start using
regular northbound infrastructure instead, because it already has a
convenient way of registering xpath-specific callbacks without the need
for creating additional structures for each necessary notification. We
also now pass a notification data to the callback, instead of a plain
JSON. This allows to use regular YANG library functions for inspecting
notification fields, instead of manually parsing the JSON.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15354 from cscarpitta/fix/fpm-pb-add-missing-include
Donald Sharp [Sun, 11 Feb 2024 01:52:47 +0000 (20:52 -0500)]
Merge pull request #15354 from cscarpitta/fix/fpm-pb-add-missing-include

qpb: Add missing `#include nexthop.h`

14 months agoqpb: Add missing `#include nexthop.h` 15354/head
Carmine Scarpitta [Fri, 9 Feb 2024 23:44:50 +0000 (00:44 +0100)]
qpb: Add missing `#include nexthop.h`

In `qpb.h` we have a bunch of functions that make use of
`union g_addr`. `union g_addr` is defined in `nexthop.h`, which
actually is NOT included in `qpb.h`.

Let's add the missing `#include nexthop.h`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
14 months agoMerge pull request #15353 from vjardin/yang_converted
Igor Ryzhov [Fri, 9 Feb 2024 23:27:23 +0000 (01:27 +0200)]
Merge pull request #15353 from vjardin/yang_converted

mgmtd: ripng, libs fully converted

14 months agolib, mgmtd: fix processing of yang notifications
Igor Ryzhov [Fri, 9 Feb 2024 22:58:49 +0000 (00:58 +0200)]
lib, mgmtd: fix processing of yang notifications

Current code assumes that notification is always sent in stripped JSON
format and therefore notification xpath starts at the third symbol of
notification data. Assuming JSON is more or less fine, because this
representation is internal to FRR, but the assumption about the xpath is
wrong, because it won't work for not top-level notifications. YANG
allows to define notification as a child for some data node deep into
the tree and in this case notification data contains not only the
notification node itself, but also all its parents.

To fix the issue, parse the notification data and get its xpath from its
schema node.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agomgmtd: ripng, libs fully converted 15353/head
Vincent JARDIN [Fri, 9 Feb 2024 18:18:48 +0000 (19:18 +0100)]
mgmtd: ripng, libs fully converted

While checking the code, we can notice that they are already converted.

Suggested-by: Igor Ryzhov <iryzhov@nfware.com>
Signed-off-by: Vincent Jardin <vjardin@free.fr>
14 months agobgpd: fix route recursion on leaked routes 15352/head
Louis Scalbert [Tue, 26 Apr 2022 14:45:42 +0000 (16:45 +0200)]
bgpd: fix route recursion on leaked routes

Leaked recursive routes are not resolved.

> VRF r1-cust1:
> B>  5.1.0.0/24 [200/98] via 99.0.0.1 (recursive), weight 1, 00:00:08
>  *                       via 192.168.1.2, r1-eth4, weight 1, 00:00:08
> B>* 99.0.0.1/32 [200/0] via 192.168.1.2, r1-eth4, weight 1, 00:00:08

> VRF r1-cust4:
> B   5.1.0.0/24 [20/98] via 99.0.0.1 (vrf r1-cust1) inactive, weight 1, 00:00:08
> B>* 99.0.0.1/32 [20/0] via 192.168.1.2, r1-eth4 (vrf r1-cust1), weight 1, 00:00:08

When announcing the routes to zebra, use the peer of the ultimate bgp
path info instead of the one of the first parent path info to determine
whether the route is recursive.

The result is:
> VRF r1-cust4:
> B>  5.1.0.0/24 [20/98] via 99.0.0.1 (vrf r1-cust1) (recursive), weight 1, 00:00:02
>   *                      via 192.168.1.2, r1-eth4 (vrf r1-cust1), weight 1, 00:00:02
> B>* 99.0.0.1/32 [20/0] via 192.168.1.2, r1-eth4 (vrf r1-cust1), weight 1, 00:00:02

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: check route recursion on leaked routes
Louis Scalbert [Fri, 9 Feb 2024 17:04:34 +0000 (18:04 +0100)]
tests: check route recursion on leaked routes

Check that leaks of a route with a recursive nexthop is possible.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agobgpd: fix minttl copying during peer reset 15347/head
Alexander Skorichenko [Fri, 9 Feb 2024 15:23:21 +0000 (16:23 +0100)]
bgpd: fix minttl copying during peer reset

Include gtsm_hops (minttl) field when copying peer structure,
so that a new connection could set a proper value.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
14 months agobgpd: Optimize memory for peer_connection struct 15346/head
Donatas Abraitis [Fri, 9 Feb 2024 15:29:35 +0000 (17:29 +0200)]
bgpd: Optimize memory for peer_connection struct

```
struct peer_connection {
struct peer *              peer;                 /*     0     8 */
enum bgp_fsm_status        status;               /*     8     4 */
enum bgp_fsm_status        ostatus;              /*    12     4 */
int                        fd;                   /*    16     4 */
uint32_t                   thread_flags;         /*    20     4 */
pthread_mutex_t            io_mtx;               /*    24    40 */
/* --- cacheline 1 boundary (64 bytes) --- */
struct stream_fifo *       ibuf;                 /*    64     8 */
struct stream_fifo *       obuf;                 /*    72     8 */
struct ringbuf *           ibuf_work;            /*    80     8 */
struct event *             t_read;               /*    88     8 */
struct event *             t_write;              /*    96     8 */
struct event *             t_connect;            /*   104     8 */
struct event *             t_delayopen;          /*   112     8 */
struct event *             t_start;              /*   120     8 */
/* --- cacheline 2 boundary (128 bytes) --- */
struct event *             t_holdtime;           /*   128     8 */
struct event *             t_connect_check_r;    /*   136     8 */
struct event *             t_connect_check_w;    /*   144     8 */
struct event *             t_gr_restart;         /*   152     8 */
struct event *             t_gr_stale;           /*   160     8 */
struct event *             t_generate_updgrp_packets; /*   168     8 */
struct event *             t_pmax_restart;       /*   176     8 */
struct event *             t_routeadv;           /*   184     8 */
/* --- cacheline 3 boundary (192 bytes) --- */
struct event *             t_process_packet;     /*   192     8 */
struct event *             t_process_packet_error; /*   200     8 */
union sockunion            su;                   /*   208   128 */

/* size: 336, cachelines: 6, members: 25 */
/* last cacheline: 16 bytes */
};   /* saved 8 bytes! */
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: Optimize memory for bgp_nexthop_cache struct
Donatas Abraitis [Fri, 9 Feb 2024 15:25:05 +0000 (17:25 +0200)]
bgpd: Optimize memory for bgp_nexthop_cache struct

```
struct bgp_nexthop_cache {
afi_t                      afi;                  /*     0     4 */
ifindex_t                  ifindex_ipv6_ll;      /*     4     4 */
struct bgp_nexthop_cache_item entry;             /*     8    32 */
uint32_t                   metric;               /*    40     4 */
uint8_t                    nexthop_num;          /*    44     1 */
_Bool                      is_evpn_gwip_nexthop; /*    45     1 */
uint16_t                   change_flags;         /*    46     2 */
struct nexthop *           nexthop;              /*    48     8 */
time_t                     last_update;          /*    56     8 */
/* --- cacheline 1 boundary (64 bytes) --- */
uint16_t                   flags;                /*    64     2 */

/* XXX 2 bytes hole, try to pack */

uint32_t                   srte_color;           /*    68     4 */
struct bgp_nexthop_cache_head * tree;            /*    72     8 */
struct prefix              prefix __attribute__((__aligned__(8))); /*    80    56 */
/* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */
void *                     nht_info;             /*   136     8 */
struct path_list           paths;                /*   144     8 */
unsigned int               path_count;           /*   152     4 */

/* XXX 4 bytes hole, try to pack */

struct bgp *               bgp;                  /*   160     8 */

/* size: 168, cachelines: 3, members: 17 */
/* sum members: 162, holes: 2, sum holes: 6 */
/* forced alignments: 1 */
/* last cacheline: 40 bytes */
} __attribute__((__aligned__(8)));   /* saved 16 bytes! */
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: Optimize memory for ecommunity struct
Donatas Abraitis [Fri, 9 Feb 2024 15:21:23 +0000 (17:21 +0200)]
bgpd: Optimize memory for ecommunity struct

```
struct ecommunity {
long unsigned int          refcnt;               /*     0     8 */
uint8_t                    unit_size;            /*     8     1 */
_Bool                      disable_ieee_floating; /*     9     1 */

/* XXX 2 bytes hole, try to pack */

uint32_t                   size;                 /*    12     4 */
uint8_t *                  val;                  /*    16     8 */
char *                     str;                  /*    24     8 */

/* size: 32, cachelines: 1, members: 6 */
/* sum members: 30, holes: 1, sum holes: 2 */
/* last cacheline: 32 bytes */
};   /* saved 8 bytes! */
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: Optimize memory for bgp_adj_out struct
Donatas Abraitis [Fri, 9 Feb 2024 15:18:22 +0000 (17:18 +0200)]
bgpd: Optimize memory for bgp_adj_out struct

```
struct bgp_adj_out {
struct rb_entry            adj_entry;            /*     0    32 */

/* XXX last struct has 4 bytes of padding */

struct update_subgroup *   subgroup;             /*    32     8 */
struct {
struct bgp_adj_out * tqe_next;           /*    40     8 */
struct bgp_adj_out * * tqe_prev;         /*    48     8 */
} subgrp_adj_train;                              /*    40    16 */
struct bgp_dest *          dest;                 /*    56     8 */
/* --- cacheline 1 boundary (64 bytes) --- */
uint32_t                   addpath_tx_id;        /*    64     4 */
uint32_t                   attr_hash;            /*    68     4 */
struct attr *              attr;                 /*    72     8 */
struct bgp_advertise *     adv;                  /*    80     8 */

/* size: 88, cachelines: 2, members: 8 */
/* paddings: 1, sum paddings: 4 */
/* last cacheline: 24 bytes */
};   /* saved 8 bytes! */
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #15327 from routingrocks/pim_evpn_traffic_loss
Jafar Al-Gharaibeh [Fri, 9 Feb 2024 15:15:01 +0000 (09:15 -0600)]
Merge pull request #15327 from routingrocks/pim_evpn_traffic_loss

pimd: re-evaluated S,G OILs upon RP changes and empty SG upstream oils

14 months agoMerge pull request #15333 from c-po/issue-14910
Donatas Abraitis [Fri, 9 Feb 2024 10:34:58 +0000 (12:34 +0200)]
Merge pull request #15333 from c-po/issue-14910

ospfd: can not delete "segment-routing node-msd" when SR if off

14 months agoMerge pull request #15336 from c-po/issue-15335
Donatas Abraitis [Fri, 9 Feb 2024 10:33:59 +0000 (12:33 +0200)]
Merge pull request #15336 from c-po/issue-15335

ospfd: add support for "no router-info [<area|as>] command"

14 months agoospfd: add support for "no router-info [<area|as>] command" 15336/head
Christian Breunig [Thu, 8 Feb 2024 21:39:04 +0000 (22:39 +0100)]
ospfd: add support for "no router-info [<area|as>] command"

frr-reload.py will walk through all config contexts and prepend no to the CLI
command. This requires that the vtysh shell code accepts a full command.

To Reproduce

vtysh -c "conf t" -c "router ospf" -c "router-info area"
vtysh -c "conf t" -c "router ospf" -c "no router-info area"
% Unknown command: no router-info area
vtysh -c "conf t" -c "router ospf" -c "no router-info"

Signed-off-by: Christian Breunig <christian@breunig.cc>
14 months agoospfd: can not delete "segment-routing node-msd" when SR if off 15333/head
Christian Breunig [Thu, 8 Feb 2024 20:53:35 +0000 (21:53 +0100)]
ospfd: can not delete "segment-routing node-msd" when SR if off

This fixes the initial implementation of commit 7743f2f8c00 ("OSPFd: Update
Segment Routing PR following review") where it wsa not possible to remove
the "segment-routing node-msd" CLI nodes via vtysh once segment-routing got
disabled.

Closes #14910

Signed-off-by: Christian Breunig <christian@breunig.cc>
14 months agoMerge pull request #15285 from idryzhov/staticd-nexthop-refcounter
Donald Sharp [Thu, 8 Feb 2024 20:53:30 +0000 (15:53 -0500)]
Merge pull request #15285 from idryzhov/staticd-nexthop-refcounter

staticd: fix nexthop tracking memory leak and add a topotest for VRFs

14 months agopimd: re-evaluated S,G OILs upon RP changes and for empty SG upstream oils 15327/head
Rajesh Varatharaj [Thu, 8 Feb 2024 02:58:39 +0000 (18:58 -0800)]
pimd: re-evaluated S,G OILs upon RP changes and for empty SG upstream oils

Topology:

TOR11 (FHR) --- LEAF-11---SPINE1 (RP)MSDP SPINE-2(RP)MSDP --- LEAF-12 -- TOR12 (LHR)
        |         |                    | |       |
|         -----------------------------------------------------(ECMP)   |
|         |                                 |               |
 -----------------------------------------------------------------------(ECMP)
Issue:
In some triggers, S,G upstream is preserved even with the PP timer expiry, resulting
in S,G with NULL OILS. This could be because we create a dummy S,G upstream and
dummy channel_oif for *,G, where RPF is UNKNOWN. As a result, PIM+VXLAN traffic is never
forwarded downstream to LHR.

Fix:
when the S,G stream is running, Determine if a reevaluation of the outgoing interface
 list (OIL) is required. S,G upstream should then inherit the OIL from *,G.

Testing:
- Evpn pim tests - TestEvpnPimSingleVtepOneMdt.test_02_broadcast_traffic_spt_zero
- pim-smoke

Ticket: #
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
14 months agozebra: When reinstalling a NHG, set REINSTALL flag 15332/head
Donald Sharp [Thu, 8 Feb 2024 17:32:26 +0000 (12:32 -0500)]
zebra: When reinstalling a NHG, set REINSTALL flag

The current code is unsetting the fact that the
NHG is installed.  It is installed but we are
reinstalling it.  Let's note this in the code
appropriately as REINSTALL and not remove the
INSTALLED FLAG.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: Move nhg reinstallation into if_up proper
Donald Sharp [Thu, 8 Feb 2024 17:22:09 +0000 (12:22 -0500)]
zebra: Move nhg reinstallation into if_up proper

The function call in to zebra_interface_nhg_reinstall
is an action that takes place on interface up events
*not* when the connected addresses are added to
a system.  this will prevent this function being
called when new connected interfaces come alive
that is an independent operation of the interface
coming up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: Remove function abstraction in interface.c
Donald Sharp [Thu, 8 Feb 2024 17:05:05 +0000 (12:05 -0500)]
zebra: Remove function abstraction in interface.c

zebra_if_nhg_dependents_XXX were just simple wrapper
functions that inited/deleted data structures.
These were already function calls themselves.  Let's
remove the abstraction and make the code simpler.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: Remove ifp_nhg_XXX functions completely
Donald Sharp [Thu, 8 Feb 2024 16:56:40 +0000 (11:56 -0500)]
zebra: Remove ifp_nhg_XXX functions completely

These functions provided a level of abstraction that forced
us to call multiple functions when a simple data structure
change was all that is needed.  Let's consolidate down
and make things a bit simpler.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: Remove helper function if_nhg_dependents_is_empty
Donald Sharp [Thu, 8 Feb 2024 16:49:08 +0000 (11:49 -0500)]
zebra: Remove helper function if_nhg_dependents_is_empty

Let's just let the function figure this out.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: Installation success should not set NHG as valid
Donald Sharp [Thu, 8 Feb 2024 16:35:31 +0000 (11:35 -0500)]
zebra: Installation success should not set NHG as valid

The nexthop group is marked as valid/invalid and then
installed.  Not installed and then marked valid.
This is just a bit of code removed that might be covering
up other problems that need to be sorted.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: Use switch when handling return from dplane for nhgs
Donald Sharp [Thu, 8 Feb 2024 16:30:30 +0000 (11:30 -0500)]
zebra: Use switch when handling return from dplane for nhgs

Convert the dplane results function for nhg's over to
using a switch for the result enum.  Let's specifically
call out the unexpected state and also set the nexthop
group as not installed when installation fails.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoMerge pull request #15255 from louis-6wind/bgp-leak-interface
Donald Sharp [Thu, 8 Feb 2024 16:18:58 +0000 (11:18 -0500)]
Merge pull request #15255 from louis-6wind/bgp-leak-interface

bgpd: fix interface of routes leaked from another VRF

14 months agoMerge pull request #15326 from pguibert6WIND/bgp_flowspec_ipv6_flush
Donald Sharp [Thu, 8 Feb 2024 15:36:00 +0000 (10:36 -0500)]
Merge pull request #15326 from pguibert6WIND/bgp_flowspec_ipv6_flush

bgpd: fix flushing ipv6 flowspec entries when peering stops

14 months agoMerge pull request #15325 from opensourcerouting/fix/show_getsockopt
Donald Sharp [Thu, 8 Feb 2024 15:33:34 +0000 (10:33 -0500)]
Merge pull request #15325 from opensourcerouting/fix/show_getsockopt

bgpd: Do not show TCP MSS if the socket is broken

14 months agoMerge pull request #15316 from LabNConsulting/working/lb/nhrp-nexthop-race-cond
Donald Sharp [Thu, 8 Feb 2024 15:31:46 +0000 (10:31 -0500)]
Merge pull request #15316 from LabNConsulting/working/lb/nhrp-nexthop-race-cond

nhrp: fix race condition in  null lladdr from zebra

14 months agoMerge pull request #15324 from opensourcerouting/fix/doc_route_map_continue
Donald Sharp [Thu, 8 Feb 2024 13:19:56 +0000 (08:19 -0500)]
Merge pull request #15324 from opensourcerouting/fix/doc_route_map_continue

doc: Fix the documentation for route-map continue statement

14 months agozebra: Conslidate zebra_nhg_set_valid|invalid functions
Donald Sharp [Wed, 7 Feb 2024 19:28:37 +0000 (14:28 -0500)]
zebra: Conslidate zebra_nhg_set_valid|invalid functions

Basically the same function two times.  Let's consolidate.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: Fixup documentation in zebra_nhg.h
Donald Sharp [Thu, 8 Feb 2024 00:50:49 +0000 (19:50 -0500)]
zebra: Fixup documentation in zebra_nhg.h

The documentation was wrong.  Let's adjust it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: dplane_nexthop_add cannot return ZEBRA_DPLANE_REQUEST_SUCCESS
Donald Sharp [Thu, 8 Feb 2024 01:32:24 +0000 (20:32 -0500)]
zebra: dplane_nexthop_add cannot return ZEBRA_DPLANE_REQUEST_SUCCESS

When installing a NHG via dplane_nexthop_add, it can only return
REQUEST_QUEUED or REQUEST_FAILURE.  There is no way SUCCESS can
be returned with the way the dplane works at this point in time.
Remove the code that attempts to set the NHE state appropriately
as it is impossible.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agonhrp: fix race condition 15316/head
Lou Berger [Tue, 6 Feb 2024 23:14:07 +0000 (23:14 +0000)]
nhrp: fix race condition

where null lladdr recieved from zebra before nhrp next hop
is installed.

Signed-off-by: Lou Berger <lberger@labn.net>
14 months agobgpd: fix flushing ipv6 flowspec entries when peering stops 15326/head
Philippe Guibert [Wed, 7 Feb 2024 21:34:34 +0000 (22:34 +0100)]
bgpd: fix flushing ipv6 flowspec entries when peering stops

When a BGP flowspec peering stops, the BGP RIB entries for IPv6
flowspec entries are removed, but not the ZEBRA RIB IPv6 entries.

Actually, when calling bgp_zebra_withdraw() function call, only
the AFI_IP parameter is passed to the bgp_pbr_update_entry() function
in charge of the Flowspec add/delete in zebra. Fix this by passing
the AFI parameter to the bgp_zebra_withdraw() function.

Note that using topotest does not show up the problem as the
flowspec driver code is not present and was refused. Without that,
routes are not installed, and can not be uninstalled.

Fixes: 529efa234655 ("bgpd: allow flowspec entries to be announced to zebra")
Link: https://github.com/FRRouting/frr/pull/2025
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
14 months agoMerge pull request #15286 from idryzhov/fix-mgmt-startup
Christian Hopps [Wed, 7 Feb 2024 21:04:11 +0000 (16:04 -0500)]
Merge pull request #15286 from idryzhov/fix-mgmt-startup

Fix conflict in mgmtd on startup

14 months agobgpd: Do not show TCP MSS if the socket is broken 15325/head
Donatas Abraitis [Wed, 7 Feb 2024 21:03:37 +0000 (23:03 +0200)]
bgpd: Do not show TCP MSS if the socket is broken

Just avoid calling for TCP MSS socket option if it's not in use.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agodoc: Fix the documentation for route-map continue statement 15324/head
Donatas Abraitis [Wed, 7 Feb 2024 20:56:17 +0000 (22:56 +0200)]
doc: Fix the documentation for route-map continue statement

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #15317 from louis-6wind/fix-affinity-map-odr
Donatas Abraitis [Wed, 7 Feb 2024 20:42:36 +0000 (22:42 +0200)]
Merge pull request #15317 from louis-6wind/fix-affinity-map-odr

lib: fix affinity map duplicate

14 months agobgpd: Add `neighbor X send-community extended rpki` command 15284/head
Donatas Abraitis [Fri, 2 Feb 2024 08:47:46 +0000 (10:47 +0200)]
bgpd: Add `neighbor X send-community extended rpki` command

By default, iBGP and eBGP-OAD peers exchange RPKI extended community by default.

Add a command to disable sending RPKI extended community if needed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agotests: Test if RPKI extended community can be disabled between peers
Donatas Abraitis [Fri, 2 Feb 2024 08:47:20 +0000 (10:47 +0200)]
tests: Test if RPKI extended community can be disabled between peers

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>