Commit Graph

35139 Commits

Author SHA1 Message Date
Christian Hopps
e6eec072ab ripngd: convert ripngd to mgmtd
- a couple small fixes for ripd conversion as well.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26 17:40:55 -05:00
Igor Ryzhov
1254d5fc4e
Merge pull request #15220 from LabNConsulting/chopps/ripd-convert
ripd to mgmtd
2024-01-26 23:29:59 +02:00
Adriano Marto Reis
f3de123ac2 tests: multiple OSPF routers connected to a single switch
A large set of routers are connected to the same switch. Each router
shares a single network. All shared networks must be reachable from all
routers.

Signed-off-by: "Adriano Marto Reis" <adrianomarto@gmail.com>
2024-01-27 06:34:02 +10:00
Donatas Abraitis
5db3bb0de9
Merge pull request #15237 from donaldsharp/sharp_watch_neighbors_more
sharpd: Add ability to turn off watching of redistribution
2024-01-26 21:09:30 +02:00
Christian Hopps
83abe9c3cb ripd: ripd convert to mgmtd
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26 12:34:46 -05:00
Igor Ryzhov
d79ca934eb 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>
2024-01-26 12:34:46 -05:00
Igor Ryzhov
b92ad5046e mgmtd: fix memleak
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-26 12:34:46 -05:00
Igor Ryzhov
771c8f3b2a 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>
2024-01-26 12:34:46 -05:00
Igor Ryzhov
7e27469337 mgmtd: fix log type
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-26 12:34:46 -05:00
Igor Ryzhov
42b815f488 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>
2024-01-26 12:34:46 -05:00
Igor Ryzhov
1bf395232d 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>
2024-01-26 12:34:23 -05:00
Igor Ryzhov
e39b60bac1 lib: add yang function for counting data nodes
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-26 12:34:23 -05:00
Christian Hopps
63ca751c11 lib: convert filters to mgmtd
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26 12:34:23 -05:00
Christian Hopps
dabc92de9e lib: convert route-map to mgmtd
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26 12:34:23 -05:00
Christian Hopps
f7594b55c2 doc: updates to mgmtd conversion documentation
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26 12:34:23 -05:00
Carmine Scarpitta
de8f61e704 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>
2024-01-26 18:24:24 +01:00
Carmine Scarpitta
9adde7f318 tests: Rename test_srv6_locator.py
It was copied, but we forgot to rename it.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-01-26 18:23:50 +01:00
Donald Sharp
3d97d2679f 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>
2024-01-26 09:26:30 -05:00
Donatas Abraitis
d48b99ad4f
Merge pull request #15233 from louis-6wind/bgp-leak-no-network
bgpd: fix VRF leaking with 'no bgp network import-check'
2024-01-26 13:09:33 +02:00
Louis Scalbert
db1bb52c4b bgpd: use bgp_labels_same in bgp_update()
Use bgp_labels_same() for all label comparisons in bgpd.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-26 12:07:01 +01:00
Philippe Guibert
f254f4b6bd bgpd: fix mpls label pointer comparison
Comparing pointers is not the appropriate way to know
if the label values are the same or not. Perform a
memcmp call instead is better.

Fixes: 8ba7105057 ("bgpd: fix valgrind flagged errors")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-26 10:16:11 +01:00
Donatas Abraitis
9b9abe1659
Merge pull request #15224 from donaldsharp/selected_fib
zebra: Cleanup dest assignment
2024-01-25 16:46:32 +02:00
Louis Scalbert
4bbfade7d6 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>
2024-01-25 15:12:10 +01:00
Louis Scalbert
45bf46441a 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>
2024-01-25 15:06:13 +01:00
Donald Sharp
7d7f90a487
Merge pull request #15223 from opensourcerouting/fix/bgp_peer_cap_uint32_to_uint64
bgpd: Increase peer's struct cap from uint32 to uint64
2024-01-25 07:32:36 -05:00
Donatas Abraitis
14c7797b72
Merge pull request #15206 from routingrocks/rajesh/pbr_map
pbrd: Fix PBR handling for last rule deletion
2024-01-25 10:00:19 +02:00
Donatas Abraitis
f31bc32196
Merge pull request #15215 from donaldsharp/pceplib_fixup
Compile issue fixups
2024-01-25 09:59:59 +02:00
Donatas Abraitis
147f476fc1
Merge pull request #15221 from mjstapp/log_immed_config
lib: add log immediate-mode to running config output
2024-01-25 09:58:45 +02:00
Donatas Abraitis
0f7577deae
Merge pull request #15226 from donaldsharp/nhg_debugs
Nhg debugs
2024-01-25 09:56:00 +02:00
Donatas Abraitis
4727a976a8
Merge pull request #15227 from donaldsharp/f_strdup
Some fixes
2024-01-25 09:55:07 +02:00
Donald Sharp
bae20ff33b 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>
2024-01-24 20:20:02 -05:00
Donald Sharp
aa474cf7b0 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>
2024-01-24 19:03:11 -05:00
Donald Sharp
827fb64ecb 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>
2024-01-24 18:29:39 -05:00
Donald Sharp
7a3b6498fc 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>
2024-01-24 18:29:34 -05:00
Donald Sharp
8d5ed65e0d 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>
2024-01-24 17:10:45 -05:00
Donatas Abraitis
5298c05bd7 bgpd: Increase peer's struct cap from uint32 to uint64
Approaching the limits of uint32.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-24 23:09:52 +02:00
Mark Stapp
2889d0e7a6 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>
2024-01-24 13:00:41 -05:00
Donald Sharp
a5613bd36d
Merge pull request #15210 from opensourcerouting/fix/use_enum_for_graceful_restart_prints
bgpd: Fix format overflow for graceful-restart debug logs
2024-01-24 12:25:57 -05:00
Donald Sharp
c3a66e5082
Merge pull request #15173 from louis-6wind/nhrp-noarp
nhrpd: unset noarp flag using a zapi message
2024-01-24 10:53:29 -05:00
Donald Sharp
16406a31d3
Merge pull request #15196 from idryzhov/nb-leaf-list
lib: remove leaf-list xpath hack from northbound
2024-01-24 10:49:52 -05:00
Donald Sharp
1ea73983fd
Merge pull request #15209 from opensourcerouting/fix/whitespaces
bgpd: Use single whitespace when displaying show bgp summary
2024-01-24 10:48:22 -05:00
Donald Sharp
8754a64da1
Merge pull request #15189 from opensourcerouting/fix/doc_label-table_json
doc: Add missing json keyword for `show debugging label-table`
2024-01-24 10:47:41 -05:00
Donald Sharp
0d638b7437 zebra: Fix opaque memory leak in rare situation
Fix this:
***********************************************************************************
Address Sanitizer Error detected in zebra_opaque.test_zebra_opaque/r3.asan.zebra.11099

=================================================================
==11099==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 66 byte(s) in 1 object(s) allocated from:
    #0 0x7f527fc06b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f527f5e852b in qmalloc lib/memory.c:100
    #2 0x56418d20832d in zread_route_add zebra/zapi_msg.c:2125
    #3 0x56418d215d08 in zserv_handle_commands zebra/zapi_msg.c:4011
    #4 0x56418d32ab5b in zserv_process_messages zebra/zserv.c:520
    #5 0x7f527f6938d3 in event_call lib/event.c:2003
    #6 0x7f527f5cb692 in frr_run lib/libfrr.c:1218
    #7 0x56418d1c3336 in main zebra/main.c:508
    #8 0x7f527e656c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 66 byte(s) leaked in 1 allocation(s).
***********************************************************************************

Code inspection leads to some code paths where the opaque data was not
freed up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-24 10:14:18 -05:00
Donald Sharp
e208a7e2cc bgpd: Fix printf formatter mistake
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-24 09:11:09 -05:00
Donald Sharp
b28eaa1c67 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>
2024-01-24 09:07:17 -05:00
Donald Sharp
e3e4232102
Merge pull request #15211 from pguibert6WIND/json_compilation_pceplib
pceplib: fix compilation error
2024-01-24 08:50:30 -05:00
Louis Scalbert
6a44127597 nhrpd: remove netlink_configure_arp declaration
Remove the unused netlink_configure_arp() declaration.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-24 10:05:52 +01:00
Louis Scalbert
3cd1c34cb7 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>
2024-01-24 10:05:49 +01:00
Louis Scalbert
bdbea51c98 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>
2024-01-24 10:05:29 +01:00
Louis Scalbert
2ee43c873e 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>
2024-01-24 10:05:29 +01:00