]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
15 months agolib: create `frr_daemon_state_{load,save}`
David Lamparter [Thu, 25 Jan 2024 17:09:17 +0000 (18:09 +0100)]
lib: create `frr_daemon_state_{load,save}`

These functions load daemon-specific persistent state from
`/var/lib/frr` and supersede open-coded variants of similar calls in
ospfd, ospf6d and isisd to save GR state and/or sequence numbers.

Unlike the open-coded variants, the save call correctly `fsync()`s the
saved data to ensure disk contents are consistent.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agolib: set up `frr_libstatedir`
David Lamparter [Thu, 25 Jan 2024 15:47:31 +0000 (16:47 +0100)]
lib: set up `frr_libstatedir`

This needs to be used for persistent state, which currently is misplaced
into `/var/run` / `/run` where it gets deleted across reboots.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: nuke `LDPD_SOCKET`
David Lamparter [Wed, 24 Jan 2024 20:50:26 +0000 (21:50 +0100)]
build: nuke `LDPD_SOCKET`

This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: nuke `ZEBRA_SERV_PATH`
David Lamparter [Wed, 24 Jan 2024 20:43:15 +0000 (21:43 +0100)]
build: nuke `ZEBRA_SERV_PATH`

This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: nuke `BFDD_CONTROL_SOCKET`
David Lamparter [Wed, 24 Jan 2024 20:38:18 +0000 (21:38 +0100)]
build: nuke `BFDD_CONTROL_SOCKET`

This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agolib, mgmtd: fix wrong mgmtd socket paths
David Lamparter [Wed, 24 Jan 2024 20:17:13 +0000 (21:17 +0100)]
lib, mgmtd: fix wrong mgmtd socket paths

These paths were ignoring the `-N` namespacing option.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months ago*: rename `frr_vtydir` to `frr_runstatedir`
David Lamparter [Wed, 24 Jan 2024 20:01:22 +0000 (21:01 +0100)]
*: rename `frr_vtydir` to `frr_runstatedir`

Also remove frr_init_vtydir(), just initialize to default.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: update packaging & docs for dir changes
David Lamparter [Thu, 25 Jan 2024 15:35:29 +0000 (16:35 +0100)]
build: update packaging & docs for dir changes

`--sysconfdir` and `--localstatedir` now align with general autoconf
practices.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: untangle sysconfdir & localstatedir
David Lamparter [Wed, 24 Jan 2024 18:32:10 +0000 (19:32 +0100)]
build: untangle sysconfdir & localstatedir

`--sysconfdir` should be `/etc` and `--localstatedir` should be `/var`.
The package-specific subdirectory should be added by configure, not
given by the user, to match established behavior by other packages.

Note that `--bindir`, `--sbindir`, `--libdir` and `--libexecdir` have
different established/expected behavior due to distro specific
multi-arch support.  That's why these are left unchanged.

The reason this is getting fixed now is that we need to use
`--localstatedir` for its actual value to put things in `/var/lib`.  As
it is now, being overloaded for `/run`, the configured `/var` path
becomes inaccessible.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: use AX_RECURSIVE_EVAL
David Lamparter [Wed, 24 Jan 2024 18:54:56 +0000 (19:54 +0100)]
build: use AX_RECURSIVE_EVAL

Replace inline expansion loop.  (Also correctly handles prefix=NONE and
exec_prefix=NONE inside the macro.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: add recursion limit for AX_RECURSIVE_EVAL
David Lamparter [Thu, 25 Jan 2024 15:09:20 +0000 (16:09 +0100)]
build: add recursion limit for AX_RECURSIVE_EVAL

The autoconf version can just loop forever, abort instead.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: add ax_recursive_eval.m4
David Lamparter [Wed, 24 Jan 2024 18:47:10 +0000 (19:47 +0100)]
build: add ax_recursive_eval.m4

As found in the GNU autoconf archive
https://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agoMerge pull request #15239 from cscarpitta/fix/fix-srv6-topotests
Donatas Abraitis [Sat, 27 Jan 2024 17:47:28 +0000 (19:47 +0200)]
Merge pull request #15239 from cscarpitta/fix/fix-srv6-topotests

tests: Fix SRv6 topotest names

15 months agoMerge pull request #15240 from LabNConsulting/chopps/convert-ripngd
Igor Ryzhov [Sat, 27 Jan 2024 03:42:34 +0000 (05:42 +0200)]
Merge pull request #15240 from LabNConsulting/chopps/convert-ripngd

ripngd: convert ripngd to mgmtd

15 months agoripngd: convert ripngd to mgmtd 15240/head
Christian Hopps [Fri, 26 Jan 2024 22:40:55 +0000 (17:40 -0500)]
ripngd: convert ripngd to mgmtd

- a couple small fixes for ripd conversion as well.

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agoMerge pull request #15220 from LabNConsulting/chopps/ripd-convert
Igor Ryzhov [Fri, 26 Jan 2024 21:29:59 +0000 (23:29 +0200)]
Merge pull request #15220 from LabNConsulting/chopps/ripd-convert

ripd to mgmtd

15 months agoMerge pull request #15237 from donaldsharp/sharp_watch_neighbors_more
Donatas Abraitis [Fri, 26 Jan 2024 19:09:30 +0000 (21:09 +0200)]
Merge pull request #15237 from donaldsharp/sharp_watch_neighbors_more

sharpd: Add ability to turn off watching of redistribution

15 months agoripd: ripd convert to mgmtd 15220/head
Christian Hopps [Fri, 19 Jan 2024 16:40:12 +0000 (16:40 +0000)]
ripd: ripd convert to mgmtd

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agomgmtd: fix commit request overwrite
Igor Ryzhov [Thu, 25 Jan 2024 11:54:45 +0000 (13:54 +0200)]
mgmtd: fix commit request overwrite

There are places, where we can receive an existing commit transaction.
If we don't check that the request already exists, it gets overwritten
and we start having problems with transaction refcounters. Forbid having
multiple configuration sessions simultaneously.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: fix memleak
Igor Ryzhov [Thu, 25 Jan 2024 11:53:53 +0000 (13:53 +0200)]
mgmtd: fix memleak

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: cleanup txn without scheduling
Igor Ryzhov [Thu, 25 Jan 2024 11:51:58 +0000 (13:51 +0200)]
mgmtd: cleanup txn without scheduling

If the transaction is not cleaned up immediately, it can be still
referenced by some threds. If it's a commit thread and it's executed
before the actual cleanup, mgmtd crashes because of the missing
commit_cfg_req.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: fix log type
Igor Ryzhov [Thu, 25 Jan 2024 11:48:52 +0000 (13:48 +0200)]
mgmtd: fix log type

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: fix sending the same value to multiple clients
Igor Ryzhov [Wed, 24 Jan 2024 21:03:24 +0000 (23:03 +0200)]
mgmtd: fix sending the same value to multiple clients

The value should not be cleared after sending it to the first client,
otherwise other clients receive an empty string.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: fix removing access/prefix lists
Igor Ryzhov [Fri, 26 Jan 2024 14:57:41 +0000 (16:57 +0200)]
lib: fix removing access/prefix lists

CLI for access/prefix list removal was using `nb_cli_apply_changes`
multiple times in the same command. It's fine for regular daemons but
not for mgmtd. Refactor the code to apply changes only once.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: add yang function for counting data nodes
Igor Ryzhov [Fri, 26 Jan 2024 14:54:36 +0000 (16:54 +0200)]
lib: add yang function for counting data nodes

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: convert filters to mgmtd
Christian Hopps [Wed, 24 Jan 2024 16:35:19 +0000 (11:35 -0500)]
lib: convert filters to mgmtd

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agolib: convert route-map to mgmtd
Christian Hopps [Wed, 24 Jan 2024 15:59:14 +0000 (10:59 -0500)]
lib: convert route-map to mgmtd

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agodoc: updates to mgmtd conversion documentation
Christian Hopps [Fri, 19 Jan 2024 16:40:34 +0000 (16:40 +0000)]
doc: updates to mgmtd conversion documentation

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agotests: Rename `test_zebra_seg6local_routes` 15239/head
Carmine Scarpitta [Fri, 26 Jan 2024 17:15:02 +0000 (18:15 +0100)]
tests: Rename `test_zebra_seg6local_routes`

The name of the `test_zebra_seg6local_routes` test is wrong. The goal
of this test is to verify seg6 routes (not seg6local routes).

Let's put the correct name.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
15 months agotests: Rename `test_srv6_locator.py`
Carmine Scarpitta [Fri, 26 Jan 2024 17:12:12 +0000 (18:12 +0100)]
tests: Rename `test_srv6_locator.py`

It was copied, but we forgot to rename it.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
15 months agosharpd: Add ability to turn off watching of redistribution 15237/head
Donald Sharp [Fri, 26 Jan 2024 14:26:30 +0000 (09:26 -0500)]
sharpd: Add ability to turn off watching of redistribution

Wanted to do some testing of redistribute without having
to restart sharpd over and over.  Added ability to
turn off the `sharp watch redistribute XX` functionality.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoMerge pull request #15233 from louis-6wind/bgp-leak-no-network
Donatas Abraitis [Fri, 26 Jan 2024 11:09:33 +0000 (13:09 +0200)]
Merge pull request #15233 from louis-6wind/bgp-leak-no-network

bgpd: fix VRF leaking with 'no bgp network import-check'

15 months agoMerge pull request #15224 from donaldsharp/selected_fib
Donatas Abraitis [Thu, 25 Jan 2024 14:46:32 +0000 (16:46 +0200)]
Merge pull request #15224 from donaldsharp/selected_fib

zebra: Cleanup dest assignment

15 months agotopotests: vpnv4 route leaking with no import-check 15233/head
Louis Scalbert [Thu, 25 Jan 2024 13:26:56 +0000 (14:26 +0100)]
topotests: vpnv4 route leaking with no import-check

Test vpnv4 route leaking with no import-check

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: fix VRF leaking with 'no bgp network import-check'
Louis Scalbert [Thu, 28 Apr 2022 15:01:35 +0000 (17:01 +0200)]
bgpd: fix VRF leaking with 'no bgp network import-check'

BGP static routes are defined using the network statement, e.g.:

> router bgp XXX
>  address-family ipv4 unicast
>   network 192.168.0.0/24

When "no bgp network import-check" is set, it is impossible to
successfully import the static routes into the BGP VPN table. The prefix
is present in the table but is not marked as valid. This issue applies
regardless of whether or not routes are present in the router's RIB.

Always mark as valid the nexthops of BGP static routes when "no bgp
network import-check" is set.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
15 months agoMerge pull request #15223 from opensourcerouting/fix/bgp_peer_cap_uint32_to_uint64
Donald Sharp [Thu, 25 Jan 2024 12:32:36 +0000 (07:32 -0500)]
Merge pull request #15223 from opensourcerouting/fix/bgp_peer_cap_uint32_to_uint64

bgpd: Increase peer's struct cap from uint32 to uint64

15 months agoMerge pull request #15206 from routingrocks/rajesh/pbr_map
Donatas Abraitis [Thu, 25 Jan 2024 08:00:19 +0000 (10:00 +0200)]
Merge pull request #15206 from routingrocks/rajesh/pbr_map

pbrd: Fix PBR handling for last rule deletion

15 months agoMerge pull request #15215 from donaldsharp/pceplib_fixup
Donatas Abraitis [Thu, 25 Jan 2024 07:59:59 +0000 (09:59 +0200)]
Merge pull request #15215 from donaldsharp/pceplib_fixup

Compile issue fixups

15 months agoMerge pull request #15221 from mjstapp/log_immed_config
Donatas Abraitis [Thu, 25 Jan 2024 07:58:45 +0000 (09:58 +0200)]
Merge pull request #15221 from mjstapp/log_immed_config

lib: add log immediate-mode to running config output

15 months agoMerge pull request #15226 from donaldsharp/nhg_debugs
Donatas Abraitis [Thu, 25 Jan 2024 07:56:00 +0000 (09:56 +0200)]
Merge pull request #15226 from donaldsharp/nhg_debugs

Nhg debugs

15 months agoMerge pull request #15227 from donaldsharp/f_strdup
Donatas Abraitis [Thu, 25 Jan 2024 07:55:07 +0000 (09:55 +0200)]
Merge pull request #15227 from donaldsharp/f_strdup

Some fixes

15 months agopceplib: Fix some new coverity issues that trickled in 15227/head
Donald Sharp [Thu, 25 Jan 2024 00:27:01 +0000 (19:27 -0500)]
pceplib: Fix some new coverity issues that trickled in

Several new issues came in because the coverity build system
was not building the test infrastrucuture for the pceplib.
Now we do, so we fixed it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agobgpd: Convert free/strdup to XSTRDUP in bgp_rfapi_cfg.c
Donald Sharp [Wed, 24 Jan 2024 18:00:03 +0000 (13:00 -0500)]
bgpd: Convert free/strdup to XSTRDUP in bgp_rfapi_cfg.c

Lots of usage of free and strdup instead of using
our internal code.  Convert over.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agozebra: Remove debugs for retrieving a new nhg id 15226/head
Donald Sharp [Sun, 21 Jan 2024 01:36:25 +0000 (20:36 -0500)]
zebra: Remove debugs for retrieving a new nhg id

This is not complicated code and if zebra is allocating
a new one.  Zebra does not need to inform the operator
about the process during debugs.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agozebra: Combine 2 debugs into 1 for NHG Detail
Donald Sharp [Sun, 21 Jan 2024 01:25:59 +0000 (20:25 -0500)]
zebra: Combine 2 debugs into 1 for NHG Detail

When debugging NHG detail there is a whole bunch
of lines surrounding the nexthop group.  Let's
clean these up since they are extremely chatty and
spawn several lines.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agozebra: Cleanup dest assignment 15224/head
Donald Sharp [Sun, 21 Jan 2024 02:32:36 +0000 (21:32 -0500)]
zebra: Cleanup dest assignment

dest was shadowing dest inside of an if statement additionally
both legs needed dest to be assigned.  Let's clean this up a
slight bit and use it appropriately

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agobgpd: Increase peer's struct cap from uint32 to uint64 15223/head
Donatas Abraitis [Tue, 23 Jan 2024 18:45:11 +0000 (20:45 +0200)]
bgpd: Increase peer's struct cap from uint32 to uint64

Approaching the limits of uint32.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agolib: add log immediate-mode to running config output 15221/head
Mark Stapp [Wed, 24 Jan 2024 18:00:41 +0000 (13:00 -0500)]
lib: add log immediate-mode to running config output

The immediate-mode config wasn't in the running config output;
add it.

Signed-off-by: Mark Stapp <mjs@labn.net>
15 months agoMerge pull request #15210 from opensourcerouting/fix/use_enum_for_graceful_restart_prints
Donald Sharp [Wed, 24 Jan 2024 17:25:57 +0000 (12:25 -0500)]
Merge pull request #15210 from opensourcerouting/fix/use_enum_for_graceful_restart_prints

bgpd: Fix format overflow for graceful-restart debug logs

15 months agoMerge pull request #15173 from louis-6wind/nhrp-noarp
Donald Sharp [Wed, 24 Jan 2024 15:53:29 +0000 (10:53 -0500)]
Merge pull request #15173 from louis-6wind/nhrp-noarp

nhrpd: unset noarp flag using a zapi message

15 months agoMerge pull request #15196 from idryzhov/nb-leaf-list
Donald Sharp [Wed, 24 Jan 2024 15:49:52 +0000 (10:49 -0500)]
Merge pull request #15196 from idryzhov/nb-leaf-list

lib: remove leaf-list xpath hack from northbound

15 months agoMerge pull request #15209 from opensourcerouting/fix/whitespaces
Donald Sharp [Wed, 24 Jan 2024 15:48:22 +0000 (10:48 -0500)]
Merge pull request #15209 from opensourcerouting/fix/whitespaces

bgpd: Use single whitespace when displaying show bgp summary

15 months agoMerge pull request #15189 from opensourcerouting/fix/doc_label-table_json
Donald Sharp [Wed, 24 Jan 2024 15:47:41 +0000 (10:47 -0500)]
Merge pull request #15189 from opensourcerouting/fix/doc_label-table_json

doc: Add missing json keyword for `show debugging label-table`

15 months agobgpd: Fix printf formatter mistake 15215/head
Donald Sharp [Wed, 24 Jan 2024 14:11:09 +0000 (09:11 -0500)]
bgpd: Fix printf formatter mistake

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agopceplib: Fix code not building properly
Donald Sharp [Wed, 24 Jan 2024 13:50:38 +0000 (08:50 -0500)]
pceplib: Fix code not building properly

The series of pceplib tests are not being run at the moment
due to them not even building.  Apparently adding the `libcunit1`
debian package is enough to get them to build in our system.
While weird, let's get this building at least for people that
have this and `--enable-werror` turned on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoMerge pull request #15211 from pguibert6WIND/json_compilation_pceplib
Donald Sharp [Wed, 24 Jan 2024 13:50:30 +0000 (08:50 -0500)]
Merge pull request #15211 from pguibert6WIND/json_compilation_pceplib

pceplib: fix compilation error

15 months agonhrpd: remove netlink_configure_arp declaration 15173/head
Louis Scalbert [Thu, 11 Jan 2024 10:38:11 +0000 (11:38 +0100)]
nhrpd: remove netlink_configure_arp declaration

Remove the unused netlink_configure_arp() declaration.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agotopotests: nhrp_topo, test absence of noarp flag
Louis Scalbert [Thu, 11 Jan 2024 10:17:54 +0000 (11:17 +0100)]
topotests: nhrp_topo, test absence of noarp flag

Test the absence the NOARP flag on rX-gre0 interfaces. It is present by
default.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agonhrpd: unset noarp flag using a zapi message
Louis Scalbert [Thu, 11 Jan 2024 10:25:36 +0000 (11:25 +0100)]
nhrpd: unset noarp flag using a zapi message

Unset the IFF_NOARP interface flag using a ZAPI message. It removes the
dependency to if.h headers.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agolib,zebra: add zapi message to control noarp flag
Louis Scalbert [Thu, 11 Jan 2024 10:24:20 +0000 (11:24 +0100)]
lib,zebra: add zapi message to control noarp flag

Add a ZAPI message to control the setting of the IFF_NOARP flag.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agopceplib: fix compilation error 15211/head
Philippe Guibert [Wed, 24 Jan 2024 08:10:17 +0000 (09:10 +0100)]
pceplib: fix compilation error

The following compilation error happens, with pcep test files.

> In file included from pceplib/test/pcep_utils_counters_test.c:31:
> pceplib/test/pcep_utils_counters_test.c: In function 'test_create_subgroup_counter':
> pceplib/test/pcep_utils_counters_test.c:127:25: error: too few arguments to function 'create_subgroup_counter'
>   127 |         CU_ASSERT_FALSE(create_subgroup_counter(subgroup, counter_id + 1,
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~
> In file included from pceplib/test/pcep_utils_counters_test.c:33:
> ./pceplib/pcep_utils_counters.h:163:6: note: declared here
>   163 | bool create_subgroup_counter(struct counters_subgroup *subgroup,
>       |      ^~~~~~~~~~~~~~~~~~~~~~~
> Makefile:10948: recipe for target 'pceplib/test/pceplib_test_pcep_utils_tests-pcep_utils_counters_test.o' failed
> make[3]: *** [pceplib/test/pceplib_test_pcep_utils_tests-pcep_utils_counters_test.o] Error 1
> make[3]: *** Waiting for unfinished jobs....

There is a missing parameter.

Fixes: 09047d2bf614 ("pceplib: add json string option to subgroup counter")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
15 months agobgpd: Fix format overflow for graceful-restart debug logs 15210/head
Donatas Abraitis [Wed, 24 Jan 2024 06:57:56 +0000 (08:57 +0200)]
bgpd: Fix format overflow for graceful-restart debug logs

Use enum instead of int, and make the compiler happy when using -format-overflow.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agoMerge pull request #15203 from donaldsharp/sharp_neigh_coverity
Donatas Abraitis [Wed, 24 Jan 2024 06:35:33 +0000 (08:35 +0200)]
Merge pull request #15203 from donaldsharp/sharp_neigh_coverity

sharpd: Fix coverity issues

15 months agoMerge pull request #15202 from idryzhov/mgmt-log
Donald Sharp [Tue, 23 Jan 2024 18:55:44 +0000 (13:55 -0500)]
Merge pull request #15202 from idryzhov/mgmt-log

mgmtd: remove unguarded debug log

15 months agoMerge pull request #15201 from louis-6wind/fix-rpki-coverity
Donatas Abraitis [Tue, 23 Jan 2024 18:52:53 +0000 (20:52 +0200)]
Merge pull request #15201 from louis-6wind/fix-rpki-coverity

bgpd: fix RPKI coverity scanner issues

15 months agodoc: Drop single whitespace from show bgp outputs 15209/head
Donatas Abraitis [Tue, 23 Jan 2024 18:42:30 +0000 (20:42 +0200)]
doc: Drop single whitespace from show bgp outputs

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agobgpd: Use single whitespace when displaying show bgp summary
Donatas Abraitis [Tue, 23 Jan 2024 18:41:49 +0000 (20:41 +0200)]
bgpd: Use single whitespace when displaying show bgp summary

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agopbrd: Fix PBR handling for last rule deletion 15206/head
Rajesh Varatharaj [Tue, 23 Jan 2024 06:24:33 +0000 (22:24 -0800)]
pbrd: Fix PBR handling for last rule deletion

Issue:
Previously, the PBR common was updated for every rule update or deletion

example:
let say we have three rule 11, 12, 13 and if we are removing rule 12. in the current code
we are making the entire map "valid" to false.

pbr-map MAP1 seq 11
match src-ip 90.1.1.2/32
set nexthop 20.1.1.2 swp1

pbr-map MAP1 seq 12
match src-ip 90.1.1.3/32
set nexthop 20.1.1.2 swp1

pbr-map MAP1 seq 13
match src-ip 90.1.1.4/32
set nexthop 20.1.1.2 swp1

no pbr-map MAP1 seq 12 ==> turns whole map valid to false.

r1(config)# end
r1# show pbr map
  pbr-map MAP1 valid: no
    Seq: 11 rule: 310
        Installed: yes Reason: Valid
        SRC IP Match: 90.1.1.2/32
        nexthop 20.1.1.2 swp1
          Installed: yes Tableid: 10002
    Seq: 13 rule: 312
        Installed: yes Reason: Valid
        SRC IP Match: 90.1.1.4/32
        nexthop 20.1.1.2 swp1
          Installed: yes Tableid: 10004

Fix:
Now, the PBR common will only be updated when the last rule is being deleted.
This change ensures that we only send a delete request to Zebra once, and only
set the valid and installed flags to false when the last rule is deleted.
This optimizes the handling of PBR rules and reduces unnecessary interactions with Zebra

Testing: UT in MR notes

Ticket: #
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
15 months agoMerge pull request #15197 from idryzhov/pim-nb-fix
Donald Sharp [Tue, 23 Jan 2024 15:37:55 +0000 (10:37 -0500)]
Merge pull request #15197 from idryzhov/pim-nb-fix

pimd: fix crash when configuring ssmpingd

15 months agosharpd: Fix coverity issues 15203/head
Donald Sharp [Tue, 23 Jan 2024 15:28:30 +0000 (10:28 -0500)]
sharpd: Fix coverity issues

New commits had an assignment instead of a comparison
option.  Coverity wisely found it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoMerge pull request #15165 from vjardin/ospf_ptmp_unumbered
Donatas Abraitis [Tue, 23 Jan 2024 15:22:28 +0000 (17:22 +0200)]
Merge pull request #15165 from vjardin/ospf_ptmp_unumbered

tests: ospf point-to-multipoint and prefix-suppress

15 months agoMerge pull request #15195 from idryzhov/vtysh-vrf-fix
Donatas Abraitis [Tue, 23 Jan 2024 15:20:44 +0000 (17:20 +0200)]
Merge pull request #15195 from idryzhov/vtysh-vrf-fix

vtysh: fix VTYSH_VRF definition

15 months agobgpd: check sockopt returns in rpki_create_socket 15201/head
Louis Scalbert [Tue, 23 Jan 2024 08:51:15 +0000 (09:51 +0100)]
bgpd: check sockopt returns in rpki_create_socket

Check (g|s)etsockopt returns in rpki_create_socket(). Coverity scanner
issues 1575916 and 1575924.

Fixes: a951752d4a ("bgpd: create cache server socket in vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: fix memory leak in rpki_create_socket
Louis Scalbert [Tue, 23 Jan 2024 10:52:04 +0000 (11:52 +0100)]
bgpd: fix memory leak in rpki_create_socket

Fix memory leak in rpki_create_socket. Coverity scanner issue 1575914.

Fixes: a951752 ("bgpd: create cache server socket in vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: fix res validity in rpki_create_socket
Louis Scalbert [Tue, 23 Jan 2024 10:52:59 +0000 (11:52 +0100)]
bgpd: fix res validity in rpki_create_socket

Fix coverity scanner issue 1575912 where res pointer is supposed to
valid in:

> socket = vrf_socket(res->ai_family, ...)

but is checked for validity a few lines later.

Note that vrf_getaddrinfo returns an error code if getaddrinfo() fails
to allocate res and in this case, rpki_create_socket() returns.

Fixes: a951752 ("bgpd: create cache server socket in vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: fix deference before check in rpki_create_socket
Louis Scalbert [Tue, 23 Jan 2024 08:29:26 +0000 (09:29 +0100)]
bgpd: fix deference before check in rpki_create_socket

Fix deference before check coverity scanner issue 1575918 in
rpki_create_socket()

Fixes: a951752d4a ("bgpd: create cache server socket in vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: fix potential null pointers in rpki
Louis Scalbert [Tue, 23 Jan 2024 08:16:24 +0000 (09:16 +0100)]
bgpd: fix potential null pointers in rpki

Fix potential NULL pointer in RPKI code. Coverity scanner issues: 1575911
1575913157591515759171575919 to 15759231575925 and 1575926.

Fixes: 1420189c11 ("bgpd: add support of rpki in vrf configure context")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agomgmtd: remove unguarded debug log 15202/head
Igor Ryzhov [Tue, 23 Jan 2024 10:36:22 +0000 (12:36 +0200)]
mgmtd: remove unguarded debug log

The log doesn't provide any valuable information, so removing it instead
of adding a check.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: remove leaf-list xpath hack from northbound 15196/head
Igor Ryzhov [Tue, 23 Jan 2024 00:09:25 +0000 (02:09 +0200)]
lib: remove leaf-list xpath hack from northbound

Currently, when editing a leaf-list, `nb_candidate_edit` expects to
receive it's xpath without a predicate and the value in a separate
argument, and then creates the full xpath. This hack is complicated,
because it depends on the operation and on the caller being a backend or
not. Instead, let's require to always include the predicate in a
leaf-list xpath. Update all the usages in the code accordingly.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agopimd: fix crash when configuring ssmpingd 15197/head
Igor Ryzhov [Tue, 23 Jan 2024 00:32:22 +0000 (02:32 +0200)]
pimd: fix crash when configuring ssmpingd

Command: `ip ssmpingd 1.1.1.1`

Backtrace:
```
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
0x00007fd1d3b02859 in __GI_abort () at abort.c:79
0x00007fd1d3e323e1 in yang_dnode_xpath_get_canon (dnode=<optimized out>, xpath_fmt=<optimized out>, ap=<optimized out>) at lib/yang_wrappers.c:61
0x00007fd1d3e34f41 in yang_dnode_get_ipv4 (addr=addr@entry=0x7ffc368554d4, dnode=<optimized out>, xpath_fmt=xpath_fmt@entry=0x5556af8680d4 "./source-addr") at lib/yang_wrappers.c:826
0x00005556af8216d3 in routing_control_plane_protocols_control_plane_protocol_pim_address_family_ssm_pingd_source_ip_create (args=0x7ffc36855530) at pimd/pim_nb_config.c:925
0x00007fd1d3dec13f in nb_callback_create (nb_node=0x5556b197ea40, nb_node=0x5556b197ea40, errmsg_len=8192, errmsg=0x7ffc36855a90 "", resource=0x5556b18fa6f8, dnode=0x5556b1ad7a10, event=NB_EV_APPLY, context=0x5556b1ad75c0) at lib/northbound.c:1260
nb_callback_configuration (context=0x5556b1ad75c0, event=NB_EV_APPLY, change=<optimized out>, errmsg=0x7ffc36855a90 "", errmsg_len=8192) at lib/northbound.c:1648
0x00007fd1d3deca6c in nb_transaction_process (event=event@entry=NB_EV_APPLY, transaction=transaction@entry=0x5556b1ad75c0, errmsg=errmsg@entry=0x7ffc36855a90 "", errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:1779
0x00007fd1d3decdd6 in nb_candidate_commit_apply (transaction=0x5556b1ad75c0, save_transaction=save_transaction@entry=true, transaction_id=transaction_id@entry=0x0, errmsg=errmsg@entry=0x7ffc36855a90 "", errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:1129
0x00007fd1d3decf15 in nb_candidate_commit (context=..., candidate=<optimized out>, save_transaction=save_transaction@entry=true, comment=comment@entry=0x0, transaction_id=transaction_id@entry=0x0, errmsg=0x7ffc36855a90 "", errmsg_len=8192) at lib/northbound.c:1162
0x00007fd1d3ded4af in nb_cli_classic_commit (vty=vty@entry=0x5556b1ada2a0) at lib/northbound_cli.c:50
0x00007fd1d3df025f in nb_cli_apply_changes_internal (vty=vty@entry=0x5556b1ada2a0, xpath_base=xpath_base@entry=0x7ffc36859b50 ".", clear_pending=clear_pending@entry=false) at lib/northbound_cli.c:177
0x00007fd1d3df06ad in nb_cli_apply_changes (vty=vty@entry=0x5556b1ada2a0, xpath_base_fmt=xpath_base_fmt@entry=0x0) at lib/northbound_cli.c:233
0x00005556af80fdd5 in pim_process_ssmpingd_cmd (vty=0x5556b1ada2a0, operation=NB_OP_CREATE, src_str=0x5556b1ad9630 "1.1.1.1") at pimd/pim_cmd_common.c:3423
0x00007fd1d3da7b0e in cmd_execute_command_real (vline=vline@entry=0x5556b1ac9520, vty=vty@entry=0x5556b1ada2a0, cmd=cmd@entry=0x0, up_level=up_level@entry=0) at lib/command.c:982
0x00007fd1d3da7cb1 in cmd_execute_command (vline=vline@entry=0x5556b1ac9520, vty=vty@entry=0x5556b1ada2a0, cmd=0x0, vtysh=vtysh@entry=0) at lib/command.c:1040
0x00007fd1d3da7e50 in cmd_execute (vty=vty@entry=0x5556b1ada2a0, cmd=cmd@entry=0x5556b1ae0a30 "ip ssmpingd 1.1.1.1", matched=matched@entry=0x0, vtysh=vtysh@entry=0) at lib/command.c:1207
0x00007fd1d3e278be in vty_command (vty=vty@entry=0x5556b1ada2a0, buf=<optimized out>) at lib/vty.c:591
0x00007fd1d3e27afd in vty_execute (vty=0x5556b1ada2a0) at lib/vty.c:1354
0x00007fd1d3e2bb23 in vtysh_read (thread=<optimized out>) at lib/vty.c:2362
0x00007fd1d3e22254 in event_call (thread=thread@entry=0x7ffc3685cd80) at lib/event.c:2003
0x00007fd1d3dce9e8 in frr_run (master=0x5556b183c830) at lib/libfrr.c:1218
0x00005556af803653 in main (argc=6, argv=<optimized out>, envp=<optimized out>) at pimd/pim_main.c:162
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoMerge pull request #15179 from donaldsharp/zebra_neigh_update
Donatas Abraitis [Tue, 23 Jan 2024 06:51:26 +0000 (08:51 +0200)]
Merge pull request #15179 from donaldsharp/zebra_neigh_update

Zebra neigh update

15 months agoMerge pull request #15193 from idryzhov/fix-bgp-rmap-probability
Donatas Abraitis [Tue, 23 Jan 2024 06:49:30 +0000 (08:49 +0200)]
Merge pull request #15193 from idryzhov/fix-bgp-rmap-probability

bgpd: fix route-map match probability deconfiguration callback

15 months agoMerge pull request #15194 from idryzhov/dist-list-fixes
Christian Hopps [Tue, 23 Jan 2024 01:44:01 +0000 (20:44 -0500)]
Merge pull request #15194 from idryzhov/dist-list-fixes

distribute-list fixes and improvements

15 months agovtysh: fix VTYSH_VRF definition 15195/head
Igor Ryzhov [Mon, 22 Jan 2024 22:17:26 +0000 (00:17 +0200)]
vtysh: fix VTYSH_VRF definition

VTYSH_VRF is a collection of daemon flags, not node flags. The current
code works only because RPKI_VRF_NODE is 1100101 in binary, which
accidentally includes VTYSH_BGPD which is actually needed.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoripngd: use correct autocompletion for distribute-list commands 15194/head
Igor Ryzhov [Mon, 22 Jan 2024 21:44:17 +0000 (23:44 +0200)]
ripngd: use correct autocompletion for distribute-list commands

Currently, we always use access-list autocompletion, even if configuring
prefix-lists. We should differentiate. Also, fix missing "IPv6"
docstring and use correct address family.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoripd: use correct autocompletion for distribute-list commands
Igor Ryzhov [Mon, 22 Jan 2024 21:34:56 +0000 (23:34 +0200)]
ripd: use correct autocompletion for distribute-list commands

Currently, we always use access-list autocompletion, even if configuring
prefix-lists. We should differentiate.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoeigrpd: use correct autocompletion for distribute-list commands
Igor Ryzhov [Mon, 22 Jan 2024 21:21:58 +0000 (23:21 +0200)]
eigrpd: use correct autocompletion for distribute-list commands

Currently, we always use access-list autocompletion, even if configuring
prefix-lists. We should differentiate. Also, use address-family-specific
autocompletion.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agobabeld: use correct autocompletion for distribute-list commands
Igor Ryzhov [Mon, 22 Jan 2024 21:21:02 +0000 (23:21 +0200)]
babeld: use correct autocompletion for distribute-list commands

Currently, we always use access-list autocompletion, even if configuring
prefix-lists. We should differentiate.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: add address-family-specific autocompletion for prefix-lists
Igor Ryzhov [Mon, 22 Jan 2024 21:20:31 +0000 (23:20 +0200)]
lib: add address-family-specific autocompletion for prefix-lists

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: remove global list of distribute-lists
Igor Ryzhov [Mon, 22 Jan 2024 21:00:43 +0000 (23:00 +0200)]
lib: remove global list of distribute-lists

It's not needed anymore, all daemons always pass context.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agobabeld: pass distribute ctx to distribute-list functions
Igor Ryzhov [Mon, 22 Jan 2024 21:00:18 +0000 (23:00 +0200)]
babeld: pass distribute ctx to distribute-list functions

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoeigrpd: convert distribute-list configuration to northbound
Igor Ryzhov [Mon, 22 Jan 2024 20:52:50 +0000 (22:52 +0200)]
eigrpd: convert distribute-list configuration to northbound

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agobgpd: fix route-map match probability deconfiguration callback 15193/head
Igor Ryzhov [Mon, 22 Jan 2024 20:31:21 +0000 (22:31 +0200)]
bgpd: fix route-map match probability deconfiguration callback

Add missing break. Currently, lib_route_map_entry_match_destroy is
called on every commit stage, but it should run only on APPLY.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agosharpd: Allow sharpd to listen to neighbor events 15179/head
Donald Sharp [Fri, 19 Jan 2024 20:13:49 +0000 (15:13 -0500)]
sharpd: Allow sharpd to listen to neighbor events

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib, nhrpd: Move neighbor reg/unreg to lib/zclient.c
Donald Sharp [Fri, 19 Jan 2024 19:51:34 +0000 (14:51 -0500)]
lib, nhrpd: Move neighbor reg/unreg to lib/zclient.c

This is needed to be generic.  Let's make it so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months ago*: Rename ZEBRA_NHRP_NEIGH_XXX to ZEBRA_NEIGH_XXX
Donald Sharp [Fri, 19 Jan 2024 19:45:25 +0000 (14:45 -0500)]
*: Rename ZEBRA_NHRP_NEIGH_XXX to ZEBRA_NEIGH_XXX

This does not need to be nhrp specific.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoMerge pull request #15185 from LabNConsulting/chopps/distlist
Igor Ryzhov [Mon, 22 Jan 2024 14:52:45 +0000 (16:52 +0200)]
Merge pull request #15185 from LabNConsulting/chopps/distlist

add northbound support to distribute-list code.

15 months agoMerge pull request #15052 from louis-6wind/rpki-vrf-92
Donatas Abraitis [Mon, 22 Jan 2024 14:16:34 +0000 (16:16 +0200)]
Merge pull request #15052 from louis-6wind/rpki-vrf-92

bgpd: add VRF support to RPKI

15 months agoripngd: use new distribute-list northbound code. 15185/head
Christian Hopps [Sun, 21 Jan 2024 21:19:28 +0000 (21:19 +0000)]
ripngd: use new distribute-list northbound code.

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agoripd: use new distribute-list northbound code.
Christian Hopps [Sun, 21 Jan 2024 14:01:58 +0000 (14:01 +0000)]
ripd: use new distribute-list northbound code.

Signed-off-by: Christian Hopps <chopps@labn.net>