]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
3 months agolib: improve error handling for datastore notifications
Christian Hopps [Fri, 17 Jan 2025 21:21:33 +0000 (21:21 +0000)]
lib: improve error handling for datastore notifications

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agolib: mgmtd: only send notify selectors to backends that provide.
Christian Hopps [Sat, 18 Jan 2025 06:57:35 +0000 (06:57 +0000)]
lib: mgmtd: only send notify selectors to backends that provide.

- Previously we sent selectors to all backends when a replace was
  done, improve this to only send them to backends that provide
  the selected state.

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agolib: mgmt_be_client handles datastore notification using CBs
Christian Hopps [Thu, 16 Jan 2025 04:13:08 +0000 (04:13 +0000)]
lib: mgmt_be_client handles datastore notification using CBs

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agolib: yang: add yang_parse_data function
Christian Hopps [Thu, 16 Jan 2025 04:14:03 +0000 (04:14 +0000)]
lib: yang: add yang_parse_data function

This is similar to notify and RPC parsers, but this is for normal datastore
data. This is initially used in handling datastore notifications being sent to
another backend client[s].

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agoMerge pull request #17814 from donaldsharp/nhg_removal_in_some_situations
Donatas Abraitis [Fri, 17 Jan 2025 15:31:19 +0000 (17:31 +0200)]
Merge pull request #17814 from donaldsharp/nhg_removal_in_some_situations

3 months agoMerge pull request #17836 from pguibert6WIND/limit_comm_list_count
Donatas Abraitis [Fri, 17 Jan 2025 10:44:24 +0000 (12:44 +0200)]
Merge pull request #17836 from pguibert6WIND/limit_comm_list_count

limit community list count

3 months agoMerge pull request #17727 from idryzhov/netns-all-daemons
Donald Sharp [Thu, 16 Jan 2025 13:11:07 +0000 (08:11 -0500)]
Merge pull request #17727 from idryzhov/netns-all-daemons

lib: introduce global -w option for VRF netns backend

3 months agoMerge pull request #17862 from LabNConsulting/chopps/ldp-snmp-fix
Donatas Abraitis [Thu, 16 Jan 2025 07:11:25 +0000 (09:11 +0200)]
Merge pull request #17862 from LabNConsulting/chopps/ldp-snmp-fix

ldp snmp/grpc test fix

3 months agotests: dont run ldp snmp test if no snmp 17862/head
Christian Hopps [Thu, 16 Jan 2025 01:07:53 +0000 (01:07 +0000)]
tests: dont run ldp snmp test if no snmp

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agotests: fix missed grpc test requirement for frr-backend addition
Christian Hopps [Thu, 16 Jan 2025 01:09:14 +0000 (01:09 +0000)]
tests: fix missed grpc test requirement for frr-backend addition

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agotests: use global -w option instead of per-daemon -n 17727/head
Igor Ryzhov [Wed, 1 Jan 2025 21:22:52 +0000 (23:22 +0200)]
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>
3 months agolib: introduce global -w option for VRF netns backend
Igor Ryzhov [Fri, 27 Dec 2024 19:33:39 +0000 (21:33 +0200)]
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>
3 months agolib, zebra: move ns context intialization to zebra
Igor Ryzhov [Fri, 27 Dec 2024 13:10:27 +0000 (15:10 +0200)]
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>
3 months agolib: remove VRF_BACKEND_UNKNOWN
Igor Ryzhov [Thu, 26 Dec 2024 21:08:21 +0000 (23:08 +0200)]
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>
3 months agoMerge pull request #17838 from opensourcerouting/msdp-topo3
Russ White [Wed, 15 Jan 2025 16:11:49 +0000 (11:11 -0500)]
Merge pull request #17838 from opensourcerouting/msdp-topo3

topotests: improve test reliability

3 months agoMerge pull request #17810 from donaldsharp/bgp_connect_refactor
Russ White [Wed, 15 Jan 2025 16:11:41 +0000 (11:11 -0500)]
Merge pull request #17810 from donaldsharp/bgp_connect_refactor

Bgp connect refactor

3 months agoMerge pull request #17855 from opensourcerouting/fix/bgp_enhe_capability_via_dynamic_...
Donald Sharp [Wed, 15 Jan 2025 15:34:39 +0000 (10:34 -0500)]
Merge pull request #17855 from opensourcerouting/fix/bgp_enhe_capability_via_dynamic_capability

bgpd: Handle ENHE capability via dynamic capability

3 months agoMerge pull request #17799 from LabNConsulting/chopps/backend-yang-model
Donald Sharp [Wed, 15 Jan 2025 15:22:11 +0000 (10:22 -0500)]
Merge pull request #17799 from LabNConsulting/chopps/backend-yang-model

mgmtd backend yang model (depends on #17796)

3 months agoMerge pull request #17776 from nabahr/group-rpf-mode
Donald Sharp [Wed, 15 Jan 2025 15:20:24 +0000 (10:20 -0500)]
Merge pull request #17776 from nabahr/group-rpf-mode

PIMD: RPF lookup mode per-group, per-source

3 months agoMerge pull request #17854 from enkechen-panw/flag-reflected
Donatas Abraitis [Wed, 15 Jan 2025 13:41:17 +0000 (15:41 +0200)]
Merge pull request #17854 from enkechen-panw/flag-reflected

bgpd: remove unused BATTR_REFLECTED for rmap_change_flags

3 months agoMerge pull request #17859 from donaldsharp/active_routes_are_active
Donatas Abraitis [Wed, 15 Jan 2025 13:01:59 +0000 (15:01 +0200)]
Merge pull request #17859 from donaldsharp/active_routes_are_active

Active routes are active

3 months agoMerge pull request #17858 from enkechen-panw/aggr-fix5
Donald Sharp [Wed, 15 Jan 2025 12:37:12 +0000 (07:37 -0500)]
Merge pull request #17858 from enkechen-panw/aggr-fix5

bgpd: move bgp_aggregate_increment() after bgp_path_info_add()

3 months agozebra: On Nexthop install failure don't set Installation failed 17859/head
Donald Sharp [Tue, 14 Jan 2025 21:23:40 +0000 (16:23 -0500)]
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>
3 months agobgpd: Handle ENHE capability via dynamic capability 17855/head
Donatas Abraitis [Tue, 14 Jan 2025 16:57:45 +0000 (18:57 +0200)]
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>
3 months agotests: Check if ENHE capability can be handled dynamically
Donatas Abraitis [Tue, 14 Jan 2025 16:56:48 +0000 (18:56 +0200)]
tests: Check if ENHE capability can be handled dynamically

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
3 months agozebra: Nexthops need to be ACTIVE in some cases
Donald Sharp [Tue, 14 Jan 2025 20:12:32 +0000 (15:12 -0500)]
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>
3 months agolib: northbound/mgmtd: add backend model support 17799/head
Christian Hopps [Mon, 6 Jan 2025 12:52:31 +0000 (07:52 -0500)]
lib: northbound/mgmtd: add backend model support

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agoMerge pull request #17796 from LabNConsulting/chopps/datastore-notifications
Donald Sharp [Tue, 14 Jan 2025 18:47:28 +0000 (13:47 -0500)]
Merge pull request #17796 from LabNConsulting/chopps/datastore-notifications

operational-state (datastore) change notifications

3 months agoMerge pull request #17581 from mjstapp/fix_fpm_netlink
Donald Sharp [Tue, 14 Jan 2025 18:42:29 +0000 (13:42 -0500)]
Merge pull request #17581 from mjstapp/fix_fpm_netlink

zebra: avoid race between FPM pthread and zebra main pthread in netlink encode/decode

3 months agobgpd: move bgp_aggregate_increment() after bgp_path_info_add() 17858/head
Enke Chen [Tue, 14 Jan 2025 18:29:22 +0000 (10:29 -0800)]
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>
3 months agoMerge pull request #17850 from Jafaral/wr-rpg
Donald Sharp [Tue, 14 Jan 2025 17:41:15 +0000 (12:41 -0500)]
Merge pull request #17850 from Jafaral/wr-rpg

pimd: always write cand-rp group config even when rp is inactive

3 months agoMerge pull request #17841 from Jafaral/pim-bsr-rp
Donald Sharp [Tue, 14 Jan 2025 17:39:52 +0000 (12:39 -0500)]
Merge pull request #17841 from Jafaral/pim-bsr-rp

pimd: fix BSR RPs timing out

3 months agobgpd: remove unused BATTR_REFLECTED for rmap_change_flags 17854/head
Enke Chen [Sun, 12 Jan 2025 08:27:12 +0000 (00:27 -0800)]
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>
3 months agoMerge pull request #17800 from opensourcerouting/fix/import_between_vrf_respect_allow...
Russ White [Tue, 14 Jan 2025 15:19:26 +0000 (10:19 -0500)]
Merge pull request #17800 from opensourcerouting/fix/import_between_vrf_respect_allowas_in

bgpd: Respect allowas-in value from the source VRF's peer

3 months agoMerge pull request #17803 from anlancs/ospfd/fix-redundant-timers
Russ White [Tue, 14 Jan 2025 15:17:20 +0000 (10:17 -0500)]
Merge pull request #17803 from anlancs/ospfd/fix-redundant-timers

ospfd: avoid the redundant timers

3 months agoMerge pull request #17806 from opensourcerouting/fix/lua5.4_support
Russ White [Tue, 14 Jan 2025 15:09:04 +0000 (10:09 -0500)]
Merge pull request #17806 from opensourcerouting/fix/lua5.4_support

Lua 5.4 support

3 months agoMerge pull request #17837 from enkechen-panw/aggr-fix4
Russ White [Tue, 14 Jan 2025 15:05:06 +0000 (10:05 -0500)]
Merge pull request #17837 from enkechen-panw/aggr-fix4

bgpd: fix churn of aggregate routes from duplicate config

3 months agoMerge pull request #17842 from enkechen-panw/aggr-safi
Donald Sharp [Tue, 14 Jan 2025 14:37:39 +0000 (09:37 -0500)]
Merge pull request #17842 from enkechen-panw/aggr-safi

bgpd: remove unused safi in bgp_aggregate structure

3 months agoMerge pull request #17846 from Jafaral/fix-latex-warn
Donald Sharp [Tue, 14 Jan 2025 14:37:09 +0000 (09:37 -0500)]
Merge pull request #17846 from Jafaral/fix-latex-warn

doc: fix LaTex warnings, add documentation to build docs

3 months agoMerge pull request #17639 from pguibert6WIND/bmp_import_vrf_view
Russ White [Tue, 14 Jan 2025 13:38:37 +0000 (08:38 -0500)]
Merge pull request #17639 from pguibert6WIND/bmp_import_vrf_view

Ability to import BMP information from a separate BGP instance

3 months agotopotest: add a test to control the community-list count 17836/head
Philippe Guibert [Fri, 10 Jan 2025 16:46:56 +0000 (17:46 +0100)]
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>
3 months agobgpd: add 'match community-count' command to restrict comm count
Philippe Guibert [Fri, 10 Jan 2025 16:29:10 +0000 (17:29 +0100)]
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>
3 months agoMerge pull request #17840 from Jafaral/pim-acl-test
Donatas Abraitis [Tue, 14 Jan 2025 07:08:41 +0000 (09:08 +0200)]
Merge pull request #17840 from Jafaral/pim-acl-test

tests: remove unnecessary wildcard fields from pim acl test

3 months agoMerge pull request #17847 from chiragshah6/freloadfix
Donatas Abraitis [Tue, 14 Jan 2025 07:07:14 +0000 (09:07 +0200)]
Merge pull request #17847 from chiragshah6/freloadfix

tools: fix frr-reload for nbr deletion of no form cmds

3 months agopimd: always write cand-rp group config even when rp is inactive 17850/head
Jafar Al-Gharaibeh [Tue, 14 Jan 2025 05:34:08 +0000 (23:34 -0600)]
pimd: always write cand-rp group config even when rp is inactive

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 months agolib: fix new (incorrect) CLANG SA warnings 17796/head
Christian Hopps [Fri, 10 Jan 2025 12:01:00 +0000 (07:01 -0500)]
lib: fix new (incorrect) CLANG SA warnings

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agotests: add datastore notification test
Christian Hopps [Wed, 8 Jan 2025 16:11:43 +0000 (11:11 -0500)]
tests: add datastore notification test

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agomgmtd: add notify selectors to filter datastore notifications
Christian Hopps [Wed, 8 Jan 2025 15:34:57 +0000 (10:34 -0500)]
mgmtd: add notify selectors to filter datastore notifications

- Additionally push the selectors down to the backends

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agolib: notify on datastore (oper-state) changes
Christian Hopps [Sat, 14 Dec 2024 23:26:49 +0000 (18:26 -0500)]
lib: notify on datastore (oper-state) changes

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agolib: if: track oper-state inline
Christian Hopps [Mon, 2 Dec 2024 00:48:53 +0000 (19:48 -0500)]
lib: if: track oper-state inline

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agolib: vrf: track oper-state inline
Christian Hopps [Wed, 8 Jan 2025 14:57:10 +0000 (09:57 -0500)]
lib: vrf: track oper-state inline

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agolib: northbound: add basic oper-state update functions
Christian Hopps [Tue, 7 Jan 2025 11:46:23 +0000 (06:46 -0500)]
lib: northbound: add basic oper-state update functions

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agotools: fix frr-reload for nbr deletion of no form cmds 17847/head
Chirag Shah [Mon, 13 Jan 2025 02:31:02 +0000 (18:31 -0800)]
tools: fix frr-reload for nbr deletion of no form cmds

When a bgp neighbor removed from associated to peer-group,
the neighbor is fully deleted, subsequent deletion of any
configuration related to the neighbor leads to failure
in frr-reload.
Handle any 'no neighbor ...' part of lines_to_del list

Testing:
Below first line would delete the neighbor swp1.10,
the existing code before the change handles to remove
config starts with 'neighbor swp1.10 ...' but not
'no neighbor swp1.10 ...'.

(Pdb) (lines_to_del)
 (('router bgp 100',), 'neighbor swp1.10 interface peer-group dpeergrp_2'),
 (('router bgp 100',), 'neighbor swp1.10 advertisement-interval 1'),
 (('router bgp 100',), 'neighbor swp1.10 timers 3 9'),
 (('router bgp 100',), 'neighbor swp1.10 timers connect 1'),
 (('router bgp 100',), 'no neighbor swp1.10 capability dynamic'),

Before fix:

(Pdb) (lines_to_del)
[(('router bgp 100',), 'neighbor swp1.10 interface peer-group dpeergrp_2'),
 (('router bgp 100',), 'no neighbor swp1.10 capability dynamic')]

frr-reload log:
2025-01-13 05:13:11,172  INFO: Executed "router bgp 100  no neighbor swp1.10 interface peer-group dpeergrp_2 exit"
2025-01-13 05:13:11,227 ERROR: Failed to execute router bgp 100  neighbor swp1.10 capability dynamic exit
2025-01-13 05:13:11,228 ERROR: "router bgp 100 --  neighbor swp1.10 capability dynamic -- exit" we failed to remove this command

After fix:

(Pdb)(lines_to_del)
 [(('router bgp 100',), 'neighbor swp1.10 interface peer-group dpeergrp_2')]

Signed-off-by: Chirag Shah <chirag@nvidia.com>
3 months agoMerge pull request #17843 from LabNConsulting/chopps/new-docker-and-doc
Jafar Al-Gharaibeh [Mon, 13 Jan 2025 19:16:49 +0000 (13:16 -0600)]
Merge pull request #17843 from LabNConsulting/chopps/new-docker-and-doc

Add Ubuntu 24.04 docker image and developer build doc

3 months agoMerge pull request #17839 from raja-rajasekar/rajasekarr/optimize_nh_compare
Mark Stapp [Mon, 13 Jan 2025 18:47:12 +0000 (13:47 -0500)]
Merge pull request #17839 from raja-rajasekar/rajasekarr/optimize_nh_compare

zebra: Optimize invoking nhg compare func

3 months agoMerge pull request #17844 from LabNConsulting/chopps/munet-0-15-3
Donald Sharp [Mon, 13 Jan 2025 17:07:33 +0000 (12:07 -0500)]
Merge pull request #17844 from LabNConsulting/chopps/munet-0-15-3

tests: update munet to 0.15.3

3 months agodoc: building html/pdf user and developer documentation 17846/head
Jafar Al-Gharaibeh [Mon, 13 Jan 2025 07:38:32 +0000 (01:38 -0600)]
doc: building html/pdf user and developer documentation

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 months agodoc: fix LaTex warning when building pdf docs
Jafar Al-Gharaibeh [Mon, 13 Jan 2025 05:00:09 +0000 (23:00 -0600)]
doc: fix LaTex warning when building pdf docs

LaTex doesn't like the Unicon character `≥` which should be represented
by the special sequnce `$\leq$`. Since this is buried all in Sphinx, and
we also have a scrip that look for the character, the easiest fix is to
just use `>=` instead which works without warnings, and without asking to
ignore every warning about the use of every instance of the special char.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 months agopimd: explicitly ensure the RP src is BSR 17841/head
Jafar Al-Gharaibeh [Sat, 11 Jan 2025 20:40:28 +0000 (14:40 -0600)]
pimd: explicitly ensure the RP src is BSR

With the recent suppoort of multiple sources of RPs, we can assume non static RPs
are BSR RPs. Just make the check explicit for BSR.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 months agopimd: fix BSR RPs timing out
Jafar Al-Gharaibeh [Sat, 11 Jan 2025 20:36:45 +0000 (14:36 -0600)]
pimd: fix BSR RPs timing out

On the BSR node itself, RPs shouldn't timeout, becase we know
the node is the BSR, and it is active!

fixes:#17587

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 months agolib: Adopt Lua stuff for Lua 5.4 17806/head
Donatas Abraitis [Thu, 9 Jan 2025 07:48:27 +0000 (09:48 +0200)]
lib: Adopt Lua stuff for Lua 5.4

lua_pcall() returns LUA_ERRGCMM in 5.3 which is already deprecated.

The constant LUA_ERRGCMM was removed.
Errors in finalizers are never propagated; instead, they generate a warning.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
3 months agoconfigure: Adopt for Lua 5.4
Donatas Abraitis [Thu, 9 Jan 2025 07:25:11 +0000 (09:25 +0200)]
configure: Adopt for Lua 5.4

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
3 months agotopotests: improve test reliability 17838/head
Rafael Zalamena [Fri, 10 Jan 2025 13:17:35 +0000 (10:17 -0300)]
topotests: improve test reliability

Decrease the protocol timers, wait for peers to connect (and test it)
then finally wait a bit more for SAs to be propagated.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 months agom4: Update ax_lua to support Lua 5.4
Donatas Abraitis [Wed, 8 Jan 2025 21:50:07 +0000 (23:50 +0200)]
m4: Update ax_lua to support Lua 5.4

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
3 months agotests: update munet to 0.15.4 17844/head
Christian Hopps [Sun, 12 Jan 2025 09:42:33 +0000 (09:42 +0000)]
tests: update munet to 0.15.4

- add readline and waitline functions for use with popen objects
- other non-topotest (munet native) run changes
  - vm/qemu support booting cloud images (rocky, ubuntu, debian)
  - native topology init commands

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agodocker: add ubuntu24-ci docker image support 17843/head
Christian Hopps [Sun, 12 Jan 2025 02:30:08 +0000 (02:30 +0000)]
docker: add ubuntu24-ci docker image support

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agodoc: add building for ubuntu 24.04, and refactor
Christian Hopps [Sun, 12 Jan 2025 02:27:10 +0000 (02:27 +0000)]
doc: add building for ubuntu 24.04, and refactor

- All 3 ubutu 2x (20.04, 22.04 and 24.04) have the same instructions
so put them in one include file.

Signed-off-by: Christian Hopps <chopps@labn.net>
3 months agobgpd: remove unused safi in bgp_aggregate structure 17842/head
Enke Chen [Sat, 11 Jan 2025 22:14:10 +0000 (14:14 -0800)]
bgpd: remove unused safi in bgp_aggregate structure

Remove the unused safi field in bgp_aggregate structure.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
3 months agobgpd: fix churn of aggregate routes from duplicate config 17837/head
Enke Chen [Sat, 11 Jan 2025 22:01:36 +0000 (14:01 -0800)]
bgpd: fix churn of aggregate routes from duplicate config

Currently when an aggregate-address is configured, the existing
entry is always removed regardless whether any change is involved.
This would create unnecessary churn of the aggregate route when
the same config is applied for the aggregate address.

The fix is to check for duplicate aggregate-address config.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
3 months agotests: remove unnecessary wildcard fields from pim acl test 17840/head
Jafar Al-Gharaibeh [Fri, 10 Jan 2025 23:32:30 +0000 (17:32 -0600)]
tests: remove unnecessary wildcard fields from pim acl test

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 months agozebra: Optimize invoking nhg compare func 17839/head
Rajasekar Raja [Fri, 10 Jan 2025 21:39:12 +0000 (13:39 -0800)]
zebra: Optimize invoking nhg compare func

In some cases, the old_re nhe and the newnhe is same and there is no
point in comparing them both since they are the same. Skip comparing in
such cases.

Ex:
2025/01/09 23:49:27.489020 ZEBRA: [W4Z4R-NTSMD] zebra_nhg_rib_find_nhe: => nhe 0x555f611d30c0 (44[38/39/45])
2025/01/09 23:49:27.489021 ZEBRA: [ZH3FQ-TE9NV] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 new id: 44 old id: 44
2025/01/09 23:49:27.489021 ZEBRA: [YB8HE-Z86GN] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 NEW 0x555f611d30c0 (44[38/39/45])
2025/01/09 23:49:27.489023 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489024 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 30.1.2.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489025 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.2[4] vrf default(0) wgt 1, with flags ACTIVE
2025/01/09 23:49:27.489026 ZEBRA: [ZM3BX-HPETZ] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 OLD 0x555f611d30c0 (44[38/39/45])
2025/01/09 23:49:27.489027 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489028 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 30.1.2.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489028 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.2[4] vrf default(0) wgt 1, with flags ACTIVE

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
3 months agoMerge pull request #17829 from Jafaral/static-metric
Donald Sharp [Fri, 10 Jan 2025 15:12:39 +0000 (10:12 -0500)]
Merge pull request #17829 from Jafaral/static-metric

tests: avoid nondeterministic route

3 months agobgpd: Only update peer connection information when needed 17810/head
Donald Sharp [Thu, 9 Jan 2025 17:51:16 +0000 (12:51 -0500)]
bgpd: Only update peer connection information when needed

Currently bgp is repeatedly grabbing peer connection information.
This is a bit overkill.  There are two situations:

a) Opening a connection to the peer
   In this case, we know the remote port/address a priori and can get
   the local information by just asking the OS.
b) Peer opening a connection to us.
   In this case, we know the local port/address a priori and can get
   the remote information by just asking the OS.

Modify the code to just grab this data at the appropriate time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 months agobgpd: su_remote and su_local are properties of the connection
Donald Sharp [Tue, 17 Dec 2024 20:56:19 +0000 (15:56 -0500)]
bgpd: su_remote and su_local are properties of the connection

su_local and su_remote in the peer can change based upon
if we are initiating the remote connection or receiving it.
As such we need to treat it as a property of the connection.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 months agobgpd: bgp_getsockanme is connection oriented
Donald Sharp [Tue, 17 Dec 2024 20:38:01 +0000 (15:38 -0500)]
bgpd: bgp_getsockanme is connection oriented

Let's make it so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 months agozebra: Uninstall NHG in some situations 17814/head
Donald Sharp [Thu, 9 Jan 2025 20:26:46 +0000 (15:26 -0500)]
zebra: Uninstall NHG in some situations

If you have this series of events:

a) Decision to install a NHG is made in zebra, enqueue to DPLANE
b) Changes to NHG are made and we remove it in the master pthread
   Since this NHG is not marked as installed it is not removed
   but the NHG data structure is deleted
c) DPLANE installs the NHG

In the end the NHG stays installed but ZEBRA has lost track of it.

Modify the removal code to check to see if the NHG is queued.
There are 2 cases:

a) NHG is kept around for a bit before being deleted.  In this case
just see that the NHG is Queued and keep it around too.

b) NHG is not kept around and we are just removing it.  In this case
check to see if it is queued and send another deletion event.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 months agoMerge pull request #17813 from enkechen-panw/aigp-fix6
Donatas Abraitis [Fri, 10 Jan 2025 14:26:34 +0000 (16:26 +0200)]
Merge pull request #17813 from enkechen-panw/aigp-fix6

bgpd: use igpmetric in bgp_aigp_metric_total()

3 months agoMerge pull request #17830 from opensourcerouting/fix/timers_bgp_default
Donald Sharp [Fri, 10 Jan 2025 14:24:00 +0000 (09:24 -0500)]
Merge pull request #17830 from opensourcerouting/fix/timers_bgp_default

bgpd: Fix showing default `timers bgp x y`

3 months agoMerge pull request #17811 from enkechen-panw/aggr-fix3
Donatas Abraitis [Fri, 10 Jan 2025 07:47:21 +0000 (09:47 +0200)]
Merge pull request #17811 from enkechen-panw/aggr-fix3

bgpd: fix memory leak in bgp_aggregate_install()

3 months agoMerge pull request #17831 from Jafaral/ospf6-nodebug
Donatas Abraitis [Fri, 10 Jan 2025 07:45:20 +0000 (09:45 +0200)]
Merge pull request #17831 from Jafaral/ospf6-nodebug

ospf6d: guard a couple of debugs

3 months agoospfd: avoid the redundant timers 17803/head
anlan_cs [Thu, 9 Jan 2025 08:36:12 +0000 (16:36 +0800)]
ospfd: avoid the redundant timers

Since the timer thread for ```OSPF_ROUTE_AGGR_DEL``` has been created,
the subsequent "no summary-address" commands shouldn't trigger redundant timers.

Signed-off-by: anlan_cs <anlan_cs@126.com>
3 months agoospf6d: guard a couple of debugs 17831/head
Jafar Al-Gharaibeh [Thu, 9 Jan 2025 23:26:10 +0000 (17:26 -0600)]
ospf6d: guard a couple of debugs

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 months agobgpd: fix memory leak in bgp_aggregate_install() 17811/head
Enke Chen [Thu, 9 Jan 2025 22:48:35 +0000 (14:48 -0800)]
bgpd: fix memory leak in bgp_aggregate_install()

Potential memory leak with as-set and matching-MED-only config.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
3 months agodoc: Document rpf-lookup-mode changes 17776/head
Nathan Bahr [Wed, 30 Oct 2024 21:33:09 +0000 (21:33 +0000)]
doc: Document rpf-lookup-mode changes

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
3 months agotests: Add tests for new RPF lookup group and source list features
Nathan Bahr [Wed, 30 Oct 2024 21:03:04 +0000 (21:03 +0000)]
tests: Add tests for new RPF lookup group and source list features

Expand existing pim_mrib tests to include testing lookup modes
specific to source and/or group as defined in prefix lists.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
3 months agopimd: Implement rpf lookup mode as a list
Nathan Bahr [Wed, 30 Oct 2024 21:21:50 +0000 (21:21 +0000)]
pimd: Implement rpf lookup mode as a list

Add the support to store lookup modes as a sorted list.
List is non-unique and sorts mode with both lists < modes with one list < global mode (no lists).
This way, when finding the right mode, we will match a lookup using a prefix list before the global mode.
Add passing group address into all lookups (using nht cache and/or synchronous lookup).
Many areas don't have a group address, use PIMADDR_ANY if no valid group is needed.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
3 months agopimd,yang: Expand rpf-lookup-mode command
Nathan Bahr [Wed, 30 Oct 2024 21:16:30 +0000 (21:16 +0000)]
pimd,yang: Expand rpf-lookup-mode command

Add options for group-list and source-list, both of which take a prefix list name.
The prefix list is used to determine the lookup mode for specific sources and/or groups.
Any number of lookup modes can be configured as long as the combination of group
and source list is unique.
A global lookup mode (empty group and source lists) is always added and defaults to mrib-then-urib
as it currently functions. The global lookup mode can be changed as it current exists with the command
`rpf-lookup-mode MODE`.
When determinig which mode to use, match source (and group if provided) against the lists, if they are set.
If a lookup does not specify a group, then only use lookup modes that do not have a group list defined.
A lookup by definition will have a source, so no special handling there.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
3 months agobgpd: Fix showing default `timers bgp x y` 17830/head
Donatas Abraitis [Thu, 9 Jan 2025 21:56:31 +0000 (23:56 +0200)]
bgpd: Fix showing default `timers bgp x y`

Fixes: ef4a9215b912c885498715614ee01b43dc861c1a ("bgpd: Reuse defined constants for BGP timers")
Fixes: ab3535fbcf37b59ec02332fa021142c5b7d6dd3e ("bgpd: Implement connect retry backoff")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
3 months agotests: avoid nondeterministic route 17829/head
Jafar Al-Gharaibeh [Thu, 9 Jan 2025 21:41:41 +0000 (15:41 -0600)]
tests: avoid nondeterministic route

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 months agoMerge pull request #17805 from donaldsharp/2_test_fixes
Jafar Al-Gharaibeh [Thu, 9 Jan 2025 21:40:08 +0000 (15:40 -0600)]
Merge pull request #17805 from donaldsharp/2_test_fixes

2 test fixes

3 months agoMerge pull request #17809 from donaldsharp/nhg_fix
Jafar Al-Gharaibeh [Thu, 9 Jan 2025 21:38:54 +0000 (15:38 -0600)]
Merge pull request #17809 from donaldsharp/nhg_fix

zebra: Fix leaked nhe

3 months agoMerge pull request #17801 from enkechen-panw/aggr-fix2
Donatas Abraitis [Thu, 9 Jan 2025 21:02:26 +0000 (23:02 +0200)]
Merge pull request #17801 from enkechen-panw/aggr-fix2

bgpd: apply route-map for aggregate before attribute comparison

3 months agoMerge pull request #17807 from louis-6wind/fix-bgp-orf-crash
Donatas Abraitis [Thu, 9 Jan 2025 20:57:51 +0000 (22:57 +0200)]
Merge pull request #17807 from louis-6wind/fix-bgp-orf-crash

bgpd: fix crash in displaying json orf prefix-list

3 months agoMerge pull request #17808 from louis-6wind/rem-if-dead
Donatas Abraitis [Thu, 9 Jan 2025 20:54:43 +0000 (22:54 +0200)]
Merge pull request #17808 from louis-6wind/rem-if-dead

lib: remove interface dead code

3 months agobgpd: use igpmetric in bgp_aigp_metric_total() 17813/head
Enke Chen [Thu, 9 Jan 2025 20:02:02 +0000 (12:02 -0800)]
bgpd: use igpmetric in bgp_aigp_metric_total()

Use igpmetric from bgp_path_info in bgp_igp_metric_total() to be
consistent with all other cases, e.g., as in bgp_path_info_cmp().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
3 months agotests: bgp_srv6l3vpn_to_bgp_vrf3 needs more time 17805/head
Donald Sharp [Wed, 8 Jan 2025 14:42:49 +0000 (09:42 -0500)]
tests: bgp_srv6l3vpn_to_bgp_vrf3 needs more time

The test starts with checking for rib insertion
of routes that may take some time after system
startup to come up.  Under heavy load this may
cause this test to just fail.  Give it more time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 months agolib: remove interface dead code 17808/head
Louis Scalbert [Thu, 9 Jan 2025 17:36:49 +0000 (18:36 +0100)]
lib: remove interface dead code

Remove interface dead code.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 months agobgpd: fix crash in displaying json orf prefix-list 17807/head
Louis Scalbert [Thu, 9 Jan 2025 17:28:53 +0000 (18:28 +0100)]
bgpd: fix crash in displaying json orf prefix-list

bgpd crashes when there is several entries in the prefix-list. No
backtrace is provided because the issue was catched from a code review.

Fixes: 856ca177c4 ("Added json formating support to show-...-neighbors-... bgp commands.")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 months agobgpd: fix bgp orf prefix-list json prefix
Louis Scalbert [Thu, 9 Jan 2025 17:24:39 +0000 (18:24 +0100)]
bgpd: fix bgp orf prefix-list json prefix

0x<address>FX was displayed instead of the prefix.

Fixes: b219dda129 ("lib: Convert usage of strings to %pFX and %pRN")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 months agozebra: Fix leaked nhe 17809/head
Donald Sharp [Thu, 9 Jan 2025 17:34:50 +0000 (12:34 -0500)]
zebra: Fix leaked nhe

During route processing in zebra, Zebra will create a nexthop
group that matches the nexthops passed down from the routing
protocol.  Then Zebra will look to see if it can re-use a
nhe from a previous version of the route entry( say a interface
goes down ).  If Zebra decides to re-use an nhe it was just dropping
the route entry created.  Which led to nexthop group's that had
a refcount of 0 and in some cases these nexthop groups were installed
into the kernel.

Add a bit of code to see if the returned entry is not being used
and it has no reference count and if so, properly dispose of it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>