Commit Graph

37133 Commits

Author SHA1 Message Date
Louis Scalbert
aceae79ae0 tests: clarify bgp_vpnv4_asbr
Clarify bgp_vpnv4_asbr. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-11-06 16:46:02 +01:00
Donatas Abraitis
1df6c57e69
Merge pull request #17363 from acooks-at-bda/fix-redundant-null-ptr-check-CID-1599962
ospf6d: remove redundant null ptr check
2024-11-06 08:10:00 +02:00
Donatas Abraitis
23c4341cfc
Merge pull request #17364 from acooks-at-bda/fix-redundant-null-ptr-check-CID-1599957
ospf6d: remove redundant null ptr check in ospf6_link_lsa_get_prefix_str() - CID 1599957
2024-11-06 08:09:20 +02:00
Andrew Cooks
8c5a0bb456 ospf6d: remove redundant null ptr check
Fix defect flagged by Coverity:

*** CID 1599957:  Null pointer dereferences  (REVERSE_INULL)
/ospf6d/ospf6_intra.c: 581 in ospf6_link_lsa_get_prefix_str()
575                                                int buflen, int pos)
576     {
577             struct ospf6_link_lsa *link_lsa = lsa_after_header(lsa->header);
578             struct ospf6_prefix *prefix = nth_prefix(lsa->header, pos);
579             struct in6_addr in6 = { 0 };
580
>>>     CID 1599957:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "lsa" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
581             if (!lsa || !prefix || !buf || buflen < (1 + INET6_ADDRSTRLEN))
582                     return NULL;
583
584             /* position zero is used for the lladdr in the body of the LSA */
585             if (pos == 0) {
586                     inet_ntop(AF_INET6, &link_lsa->linklocal_addr, buf, buflen);

The check for lsa being not-null happens in ospf6_lsdb_show() and
first dereference happens in ospf6_lsa_show_summary()

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
2024-11-06 11:06:31 +10:00
Andrew Cooks
24d8d95dd1 ospf6d: remove redundant null ptr check
Fix defect flagged by Coverity:

*** CID 1599962:  Null pointer dereferences  (REVERSE_INULL)
/ospf6d/ospf6_intra.c: 775 in ospf6_intra_prefix_lsa_get_prefix_str()
769     {
770             struct ospf6_prefix *prefix = nth_prefix(lsa->header, pos);
771             struct in6_addr in6 = { 0 };
772             char tbuf[16];
773
774             /* ensure buflen >= INET6_ADDRSTRLEN + '/128\0' */
>>>     CID 1599962:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "lsa" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
775             if (!lsa || !prefix || !buf || buflen < (5 + INET6_ADDRSTRLEN))
776                     return NULL;
777
778             memcpy(&in6, OSPF6_PREFIX_BODY(prefix),
779                    OSPF6_PREFIX_SPACE(prefix->prefix_length));
780             inet_ntop(AF_INET6, &in6, buf, buflen);

The check for lsa being not-null happens in ospf6_lsdb_show() and
first dereference happens in ospf6_lsa_show_summary()

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
2024-11-06 11:00:13 +10:00
Jafar Al-Gharaibeh
905fc5c611
Merge pull request #17346 from LabNConsulting/aceelindem/fix_ospf_refresh_interval_assert
ospfd: Fix assert in LSA refresh interval setting
2024-11-05 13:30:24 -06:00
Russ White
fe20f83286
Merge pull request #17326 from anlancs/fix/zebra-no-ifp-down
zebra: fix missing kernel routes
2024-11-05 10:20:36 -05:00
Russ White
408decfd77
Merge pull request #17319 from opensourcerouting/fix/no_ospf_router-id
ospfd: Use router_id what Zebra has if we remove a static router_id
2024-11-05 10:19:44 -05:00
Russ White
318e983a59
Merge pull request #17305 from opensourcerouting/fix/bgp_community_list_numbered
bgpd: Treat numbered community-list only if it's in a range 1-500
2024-11-05 10:16:07 -05:00
Jafar Al-Gharaibeh
f68d5b3811
Merge pull request #16750 from donaldsharp/table_display_is_not_vrf_based_in_some_cases
zebra: Don't display the vrf if not using namespace based vrfs
2024-11-05 09:10:39 -06:00
Russ White
ab2117d328
Merge pull request #17115 from LabNConsulting/jmuthii/nhrpd-retry-resolution-topotest
nhrpd: fix passphrase handling, add topotest for resolution request
2024-11-05 10:10:12 -05:00
Acee
64c67c1ce0 ospfd: Fix assert in LSA refresh interval setting
Under certain timing conditions, the current logic asserts in
ospf_lsa_refresh_delay(). While this isn't readily reproducible,
the only explanation is that the conversion from struct timeval
to milliseconds is 0 due to rounding off the microseconds.

Signed-off-by: Acee <aceelindem@gmail.com>
2024-11-05 10:03:28 -05:00
Donald Sharp
e88cbd65dd zebra: Remove large indentation level in do_show_route_helper
CI is complaining about the large level of indentation.
Make it a bit better.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-11-04 13:02:36 -05:00
Donald Sharp
f51d2a6b97 zebra: Don't display the vrf if not using namespace based vrfs
Currently when doing a `show ip route table XXXX`, zebra is displaying
the current default vrf as the vrf we are in.  We are displaying a
table not a vrf.  This is only true if you are not using namespace
based vrf's, so modify the output to display accordingly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-11-04 12:14:47 -05:00
Mark Stapp
960462aade
Merge pull request #16960 from donaldsharp/zebra_nhg_startup_issue
zebra: On startup actually allow for nhe's to be early
2024-11-04 11:49:30 -05:00
Donald Sharp
4c525a47c8
Merge pull request #17332 from nabahr/fix-import-test
tests: Remove unnecessary fields from expected JSON
2024-11-03 17:54:20 -05:00
Donald Sharp
03012e4fa7
Merge pull request #17333 from cscarpitta/fix/fix-srv6-docs-misspelling
doc: Fix a couple of misspellings in zebra documentation
2024-11-03 17:53:37 -05:00
Donald Sharp
747d116b65
Merge pull request #17334 from cscarpitta/fix/fix-wrong-srv6-debug-macros
zebra: Fix incorrect debug macros
2024-11-03 17:53:05 -05:00
Donald Sharp
e2256e3bc2
Merge pull request #17335 from cscarpitta/fix/bgp-use-ipv6-max-bitlen
bgpd: Replace 128 with `IPV6_MAX_BITLEN`
2024-11-03 17:51:20 -05:00
Carmine Scarpitta
29729027de bgpd: Use IPV6_MAX_BITLEN when deleting SRv6 VPN6 SIDs
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:54:43 +01:00
Carmine Scarpitta
688aaa4e62 bgpd: Use IPV6_MAX_BITLEN when deleting SRv6 VPN4 SIDs
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:54:32 +01:00
Carmine Scarpitta
d3a9fe9993 bgpd: Use IPV6_MAX_BITLEN when deleting SRv6 functions
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:54:03 +01:00
Carmine Scarpitta
afd9d3f924 zebra: Fix wrong debug macro in release_srv6_sid_func_dynamic
`ZEBRA_DEBUG_SRV6` is not the correct macro to evaluate if SRv6 debug is enabled or not.

The correct macro is `IS_ZEBRA_DEBUG_SRV6`.

Fix this by replacing `ZEBRA_DEBUG_SRV6` with `IS_ZEBRA_DEBUG_SRV6`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:45:03 +01:00
Carmine Scarpitta
69b1acf4e3 zebra: Fix wrong debug macro in release_srv6_sid_func_explicit
`ZEBRA_DEBUG_SRV6` is not the correct macro to evaluate if SRv6 debug is enabled or not.

The correct macro is `IS_ZEBRA_DEBUG_SRV6`.

Fix this by replacing `ZEBRA_DEBUG_SRV6` with `IS_ZEBRA_DEBUG_SRV6`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:44:41 +01:00
Carmine Scarpitta
d1810d5c7f zebra: Fix wrong debug macro in alloc_srv6_sid_func_dynamic
`ZEBRA_DEBUG_SRV6` is not the correct macro to evaluate if SRv6 debug is enabled or not.

The correct macro is `IS_ZEBRA_DEBUG_SRV6`.

Fix this by replacing `ZEBRA_DEBUG_SRV6` with `IS_ZEBRA_DEBUG_SRV6`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:44:23 +01:00
Carmine Scarpitta
58fd136f44 zebra: Fix wrong debug macro in alloc_srv6_sid_func_explicit
`ZEBRA_DEBUG_SRV6` is not the correct macro to evaluate if SRv6 debug is enabled or not.

The correct macro is `IS_ZEBRA_DEBUG_SRV6`.

Fix this by replacing `ZEBRA_DEBUG_SRV6` with `IS_ZEBRA_DEBUG_SRV6`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:43:55 +01:00
Carmine Scarpitta
a56e790b07 zebra: Fix wrong debug macro in release_srv6_sid_func_dynamic
`ZEBRA_DEBUG_SRV6` is not the correct macro to evaluate if SRv6 debug is enabled or not.

The correct macro is `IS_ZEBRA_DEBUG_SRV6`.

Fix this by replacing `ZEBRA_DEBUG_SRV6` with `IS_ZEBRA_DEBUG_SRV6`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:43:38 +01:00
Carmine Scarpitta
8e96fcece2 zebra: Fix wrong debug macro in release_srv6_sid_func_explicit
`ZEBRA_DEBUG_SRV6` is not the correct macro to evaluate if SRv6 debug is enabled or not.

The correct macro is `IS_ZEBRA_DEBUG_SRV6`.

Fix this by replacing `ZEBRA_DEBUG_SRV6` with `IS_ZEBRA_DEBUG_SRV6`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:43:17 +01:00
Carmine Scarpitta
4710baa7bb zebra: Fix wrong debug macro in alloc_srv6_sid_func_dynamic
`ZEBRA_DEBUG_SRV6` is not the correct macro to evaluate if SRv6 debug is enabled or not.

The correct macro is `IS_ZEBRA_DEBUG_SRV6`.

Fix this by replacing `ZEBRA_DEBUG_SRV6` with `IS_ZEBRA_DEBUG_SRV6`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:42:58 +01:00
Carmine Scarpitta
973c4750e1 zebra: Fix wrong debug macro in alloc_srv6_sid_func_explicit
`ZEBRA_DEBUG_SRV6` is not the correct macro to evaluate if SRv6 debug is enabled or not.

The correct macro is `IS_ZEBRA_DEBUG_SRV6`.

Fix this by replacing `ZEBRA_DEBUG_SRV6` with `IS_ZEBRA_DEBUG_SRV6`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:42:36 +01:00
Carmine Scarpitta
6705703c2c doc: Fix misspelling SRv6 formats command
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 08:00:04 +01:00
Carmine Scarpitta
7a58e5e3e2 doc: Fix misspelling locator format command
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 07:59:56 +01:00
Carmine Scarpitta
f948d8a536 doc: Fix misspelling behavior usid command
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 07:59:52 +01:00
Carmine Scarpitta
52b5e66f65 doc: Fix misspelling locator prefix command
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-11-03 07:59:48 +01:00
Donald Sharp
9e74dda819 zebra: Delay some processing until after startup is finished
Currently zebra starts the graceful restart timer as well as
allows connections from clients before all data is read in
from the kernel as well as the possiblity of allowing client
connections before this happens as well.

Let's move the graceful restart timer start till after this is
done as well as not allowing client connections till then as well.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-11-01 14:43:50 -04:00
Nathan Bahr
5b3c3b1710 tests: Remove unnecessary fields from expected JSON
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-11-01 16:46:41 +00:00
Donatas Abraitis
a69f66176d
Merge pull request #17312 from donaldsharp/remove_in6addr_cmp
Remove in6addr cmp
2024-11-01 18:06:04 +02:00
Donatas Abraitis
4411ee9865
Merge pull request #17280 from donaldsharp/remove_event_master_free_unused
Remove event master free unused
2024-11-01 18:03:44 +02:00
Russ White
77632a7ec3
Merge pull request #17194 from LabNConsulting/aceelindem/ospf-ls-refresh-interval-fix
ospfd: Fix opaque LSA refresh interval and modify LSA cmds.
2024-11-01 11:37:32 -04:00
anlan_cs
0073a870d1 test: add test case for kernel blackhole routes
The test verifies that a kernel blackhole route is not affected by
interface's link change.

Signed-off-by: anlan_cs <anlan_cs@126.com>
2024-11-01 22:43:00 +08:00
Jafar Al-Gharaibeh
248ee22b9d
Merge pull request #17230 from donaldsharp/clang_19_some_more
Clang 19 some more
2024-11-01 09:02:31 -05:00
Donald Sharp
eded1e9c76
Merge pull request #17328 from opensourcerouting/fix/allow_setting_netlink_buffer_size_for_zebra
tests: Do not set by default netlink receive buffer size for Zebra
2024-11-01 10:00:18 -04:00
Mark Stapp
23c92ed04f
Merge pull request #17329 from donaldsharp/wheel_name_is_useless
lib: Remove wheel name it is no longer used
2024-11-01 09:30:39 -04:00
Donatas Abraitis
dfcb75a2b9
Merge pull request #17330 from donaldsharp/revert_ospf_asbr_status_change
Revert "ospfd: update ospf_asbr_status when using no_area_nssa command"
2024-11-01 10:11:13 +02:00
Donald Sharp
dbc4ba99a9 Revert "ospfd: update ospf_asbr_status when using no_area_nssa command"
This reverts commit 71aa5ab7f6.
2024-10-31 21:35:51 -04:00
Jafar Al-Gharaibeh
66ed5c1d9c
Merge pull request #17327 from donaldsharp/bgp_update_optimizations
Bgp update optimizations
2024-10-31 15:06:42 -05:00
Donald Sharp
cd80fa0af4 lib: Remove counter and a function
The `alloc` counter was tracking the current active
number of events in the system and if it went to
0 when freeing a new one it would assert.  This
assert is a duplicate of what would happen with the
XFREE in the same situation.  As such it is not
necessary.

Also remove the `event_master_free_unused` function
from the system.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 14:07:04 -04:00
Donald Sharp
2b1e5ced04 bgpd: Remove call into event_master_free_unused
This call was originally put into place to help reduce
memory problems associated with bgp having a bajillion
events under load and then we would have a bunch of events
ready to be used on the unused list.  In the meantime
code was put into place that limited the depth of the
unused list to 10 elements.  This call has now become
unnecessary.  Let's just remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 14:06:20 -04:00
Donald Sharp
97c17c1e8b lib: Remove wheel name it is no longer used
With commit:
60a3efec24

The ability for the wheel code to display the name of what
wheel was actually being run was removed from the system.
Since we can no longer do this and it's been 4 years since it's
been in, let's just remove this bit of dead code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 13:55:48 -04:00
Donald Sharp
66feece071
Merge pull request #17281 from nabahr/mrib-import
Add support to import alternate URIB tables into the main MRIB
2024-10-31 13:28:57 -04:00