Commit Graph

34623 Commits

Author SHA1 Message Date
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
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
Philippe Guibert
838c8857b1 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: 09047d2bf6 ("pceplib: add json string option to subgroup counter")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-01-24 09:12:35 +01:00
Donatas Abraitis
2c69b4b516 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>
2024-01-24 09:06:43 +02:00
Donatas Abraitis
03d6a6d137
Merge pull request #15203 from donaldsharp/sharp_neigh_coverity
sharpd: Fix coverity issues
2024-01-24 08:35:33 +02:00
Donald Sharp
d1ce73a0fe
Merge pull request #15202 from idryzhov/mgmt-log
mgmtd: remove unguarded debug log
2024-01-23 13:55:44 -05:00
Donatas Abraitis
a2ce7f1e4f
Merge pull request #15201 from louis-6wind/fix-rpki-coverity
bgpd: fix RPKI coverity scanner issues
2024-01-23 20:52:53 +02:00
Donatas Abraitis
b261464cc1 doc: Drop single whitespace from show bgp outputs
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-23 20:42:30 +02:00
Donatas Abraitis
a1baf9e84f bgpd: Use single whitespace when displaying show bgp summary
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-23 20:41:49 +02:00
Rajesh Varatharaj
aa12c72c2a 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>
2024-01-23 09:04:34 -08:00
Donald Sharp
edd4a8571d
Merge pull request #15197 from idryzhov/pim-nb-fix
pimd: fix crash when configuring ssmpingd
2024-01-23 10:37:55 -05:00
Donald Sharp
2703f331e2 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>
2024-01-23 10:28:30 -05:00
Donatas Abraitis
3ab8fc13c1
Merge pull request #15165 from vjardin/ospf_ptmp_unumbered
tests: ospf point-to-multipoint and prefix-suppress
2024-01-23 17:22:28 +02:00
Donatas Abraitis
5435d963b3
Merge pull request #15195 from idryzhov/vtysh-vrf-fix
vtysh: fix VTYSH_VRF definition
2024-01-23 17:20:44 +02:00
Louis Scalbert
efdb5f144c 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>
2024-01-23 13:13:13 +01:00