]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
5 months agotests: Check if stale routes with addpath are marked with LLGR community 17376/head
Donatas Abraitis [Thu, 7 Nov 2024 12:01:39 +0000 (14:01 +0200)]
tests: Check if stale routes with addpath are marked with LLGR community

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agotests: Check if routes with addpath are cleared if they are stale
Donatas Abraitis [Thu, 7 Nov 2024 11:17:12 +0000 (13:17 +0200)]
tests: Check if routes with addpath are cleared if they are stale

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agobgpd: Set LLGR stale routes for all the paths including addpath
Donatas Abraitis [Thu, 7 Nov 2024 11:08:35 +0000 (13:08 +0200)]
bgpd: Set LLGR stale routes for all the paths including addpath

Without this patch we set only the first path for the route (if multiple exist)
as LLGR stale and stop doing that for the rest of the paths, which is wrong.

Fixes: 1479ed2fb35f4a5ae1017201a7ee37ba2727163a ("bgpd: Implement LLGR helper mode")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agobgpd: Clear all paths including addpath once GR expires
Donatas Abraitis [Thu, 7 Nov 2024 11:04:54 +0000 (13:04 +0200)]
bgpd: Clear all paths including addpath once GR expires

We iterated over all bgp_path_info's, but once we remove the path, we didn't
check for other paths under the same bgp_dest.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agoMerge pull request #17363 from acooks-at-bda/fix-redundant-null-ptr-check-CID-1599962
Donatas Abraitis [Wed, 6 Nov 2024 06:10:00 +0000 (08:10 +0200)]
Merge pull request #17363 from acooks-at-bda/fix-redundant-null-ptr-check-CID-1599962

ospf6d: remove redundant null ptr check

5 months agoMerge pull request #17364 from acooks-at-bda/fix-redundant-null-ptr-check-CID-1599957
Donatas Abraitis [Wed, 6 Nov 2024 06:09:20 +0000 (08:09 +0200)]
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

5 months agoospf6d: remove redundant null ptr check 17364/head
Andrew Cooks [Wed, 6 Nov 2024 01:06:31 +0000 (11:06 +1000)]
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>
5 months agoospf6d: remove redundant null ptr check 17363/head
Andrew Cooks [Wed, 6 Nov 2024 00:50:53 +0000 (10:50 +1000)]
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>
5 months agoMerge pull request #17346 from LabNConsulting/aceelindem/fix_ospf_refresh_interval_assert
Jafar Al-Gharaibeh [Tue, 5 Nov 2024 19:30:24 +0000 (13:30 -0600)]
Merge pull request #17346 from LabNConsulting/aceelindem/fix_ospf_refresh_interval_assert

ospfd: Fix assert in LSA refresh interval setting

5 months agoMerge pull request #17326 from anlancs/fix/zebra-no-ifp-down
Russ White [Tue, 5 Nov 2024 15:20:36 +0000 (10:20 -0500)]
Merge pull request #17326 from anlancs/fix/zebra-no-ifp-down

zebra: fix missing kernel routes

5 months agoMerge pull request #17319 from opensourcerouting/fix/no_ospf_router-id
Russ White [Tue, 5 Nov 2024 15:19:44 +0000 (10:19 -0500)]
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

5 months agoMerge pull request #17305 from opensourcerouting/fix/bgp_community_list_numbered
Russ White [Tue, 5 Nov 2024 15:16:07 +0000 (10:16 -0500)]
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

5 months agoMerge pull request #16750 from donaldsharp/table_display_is_not_vrf_based_in_some_cases
Jafar Al-Gharaibeh [Tue, 5 Nov 2024 15:10:39 +0000 (09:10 -0600)]
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

5 months agoMerge pull request #17115 from LabNConsulting/jmuthii/nhrpd-retry-resolution-topotest
Russ White [Tue, 5 Nov 2024 15:10:12 +0000 (10:10 -0500)]
Merge pull request #17115 from LabNConsulting/jmuthii/nhrpd-retry-resolution-topotest

nhrpd: fix passphrase handling, add topotest for resolution request

5 months agoospfd: Fix assert in LSA refresh interval setting 17346/head
Acee [Tue, 5 Nov 2024 15:03:28 +0000 (10:03 -0500)]
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>
5 months agozebra: Remove large indentation level in do_show_route_helper 16750/head
Donald Sharp [Mon, 4 Nov 2024 18:02:36 +0000 (13:02 -0500)]
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>
5 months agozebra: Don't display the vrf if not using namespace based vrfs
Donald Sharp [Thu, 5 Sep 2024 13:11:04 +0000 (09:11 -0400)]
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>
5 months agoMerge pull request #16960 from donaldsharp/zebra_nhg_startup_issue
Mark Stapp [Mon, 4 Nov 2024 16:49:30 +0000 (11:49 -0500)]
Merge pull request #16960 from donaldsharp/zebra_nhg_startup_issue

zebra: On startup actually allow for nhe's to be early

5 months agoMerge pull request #17332 from nabahr/fix-import-test
Donald Sharp [Sun, 3 Nov 2024 22:54:20 +0000 (17:54 -0500)]
Merge pull request #17332 from nabahr/fix-import-test

tests: Remove unnecessary fields from expected JSON

5 months agoMerge pull request #17333 from cscarpitta/fix/fix-srv6-docs-misspelling
Donald Sharp [Sun, 3 Nov 2024 22:53:37 +0000 (17:53 -0500)]
Merge pull request #17333 from cscarpitta/fix/fix-srv6-docs-misspelling

doc: Fix a couple of misspellings in zebra documentation

5 months agoMerge pull request #17334 from cscarpitta/fix/fix-wrong-srv6-debug-macros
Donald Sharp [Sun, 3 Nov 2024 22:53:05 +0000 (17:53 -0500)]
Merge pull request #17334 from cscarpitta/fix/fix-wrong-srv6-debug-macros

zebra: Fix incorrect debug macros

5 months agoMerge pull request #17335 from cscarpitta/fix/bgp-use-ipv6-max-bitlen
Donald Sharp [Sun, 3 Nov 2024 22:51:20 +0000 (17:51 -0500)]
Merge pull request #17335 from cscarpitta/fix/bgp-use-ipv6-max-bitlen

bgpd: Replace 128 with `IPV6_MAX_BITLEN`

5 months agobgpd: Use `IPV6_MAX_BITLEN` when deleting SRv6 VPN6 SIDs 17335/head
Carmine Scarpitta [Sun, 3 Nov 2024 07:54:43 +0000 (08:54 +0100)]
bgpd: Use `IPV6_MAX_BITLEN` when deleting SRv6 VPN6 SIDs

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
5 months agobgpd: Use `IPV6_MAX_BITLEN` when deleting SRv6 VPN4 SIDs
Carmine Scarpitta [Sun, 3 Nov 2024 07:54:32 +0000 (08:54 +0100)]
bgpd: Use `IPV6_MAX_BITLEN` when deleting SRv6 VPN4 SIDs

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
5 months agobgpd: Use `IPV6_MAX_BITLEN` when deleting SRv6 functions
Carmine Scarpitta [Sun, 3 Nov 2024 07:54:03 +0000 (08:54 +0100)]
bgpd: Use `IPV6_MAX_BITLEN` when deleting SRv6 functions

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
5 months agozebra: Fix wrong debug macro in `release_srv6_sid_func_dynamic` 17334/head
Carmine Scarpitta [Sun, 3 Nov 2024 07:45:03 +0000 (08:45 +0100)]
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>
5 months agozebra: Fix wrong debug macro in `release_srv6_sid_func_explicit`
Carmine Scarpitta [Sun, 3 Nov 2024 07:44:41 +0000 (08:44 +0100)]
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>
5 months agozebra: Fix wrong debug macro in `alloc_srv6_sid_func_dynamic`
Carmine Scarpitta [Sun, 3 Nov 2024 07:44:23 +0000 (08:44 +0100)]
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>
5 months agozebra: Fix wrong debug macro in `alloc_srv6_sid_func_explicit`
Carmine Scarpitta [Sun, 3 Nov 2024 07:43:55 +0000 (08:43 +0100)]
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>
5 months agozebra: Fix wrong debug macro in `release_srv6_sid_func_dynamic`
Carmine Scarpitta [Sun, 3 Nov 2024 07:43:38 +0000 (08:43 +0100)]
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>
5 months agozebra: Fix wrong debug macro in `release_srv6_sid_func_explicit`
Carmine Scarpitta [Sun, 3 Nov 2024 07:43:17 +0000 (08:43 +0100)]
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>
5 months agozebra: Fix wrong debug macro in `alloc_srv6_sid_func_dynamic`
Carmine Scarpitta [Sun, 3 Nov 2024 07:42:58 +0000 (08:42 +0100)]
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>
5 months agozebra: Fix wrong debug macro in `alloc_srv6_sid_func_explicit`
Carmine Scarpitta [Sun, 3 Nov 2024 07:42:36 +0000 (08:42 +0100)]
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>
5 months agodoc: Fix misspelling SRv6 formats command 17333/head
Carmine Scarpitta [Sun, 3 Nov 2024 06:51:04 +0000 (07:51 +0100)]
doc: Fix misspelling SRv6 formats command

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
5 months agodoc: Fix misspelling locator format command
Carmine Scarpitta [Sun, 3 Nov 2024 06:50:11 +0000 (07:50 +0100)]
doc: Fix misspelling locator format command

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
5 months agodoc: Fix misspelling behavior usid command
Carmine Scarpitta [Sun, 3 Nov 2024 06:49:06 +0000 (07:49 +0100)]
doc: Fix misspelling behavior usid command

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
5 months agodoc: Fix misspelling locator prefix command
Carmine Scarpitta [Sun, 3 Nov 2024 06:48:44 +0000 (07:48 +0100)]
doc: Fix misspelling locator prefix command

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
5 months agozebra: Delay some processing until after startup is finished 16960/head
Donald Sharp [Mon, 30 Sep 2024 16:41:06 +0000 (12:41 -0400)]
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>
5 months agotests: Remove unnecessary fields from expected JSON 17332/head
Nathan Bahr [Fri, 1 Nov 2024 16:46:41 +0000 (16:46 +0000)]
tests: Remove unnecessary fields from expected JSON

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
5 months agoMerge pull request #17312 from donaldsharp/remove_in6addr_cmp
Donatas Abraitis [Fri, 1 Nov 2024 16:06:04 +0000 (18:06 +0200)]
Merge pull request #17312 from donaldsharp/remove_in6addr_cmp

Remove in6addr cmp

5 months agoMerge pull request #17280 from donaldsharp/remove_event_master_free_unused
Donatas Abraitis [Fri, 1 Nov 2024 16:03:44 +0000 (18:03 +0200)]
Merge pull request #17280 from donaldsharp/remove_event_master_free_unused

Remove event master free unused

5 months agoMerge pull request #17194 from LabNConsulting/aceelindem/ospf-ls-refresh-interval-fix
Russ White [Fri, 1 Nov 2024 15:37:32 +0000 (11:37 -0400)]
Merge pull request #17194 from LabNConsulting/aceelindem/ospf-ls-refresh-interval-fix

ospfd: Fix opaque LSA refresh interval and modify LSA cmds.

5 months agotest: add test case for kernel blackhole routes 17326/head
anlan_cs [Fri, 1 Nov 2024 07:16:09 +0000 (15:16 +0800)]
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>
5 months agoMerge pull request #17230 from donaldsharp/clang_19_some_more
Jafar Al-Gharaibeh [Fri, 1 Nov 2024 14:02:31 +0000 (09:02 -0500)]
Merge pull request #17230 from donaldsharp/clang_19_some_more

Clang 19 some more

5 months agoMerge pull request #17328 from opensourcerouting/fix/allow_setting_netlink_buffer_siz...
Donald Sharp [Fri, 1 Nov 2024 14:00:18 +0000 (10:00 -0400)]
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

5 months agoMerge pull request #17329 from donaldsharp/wheel_name_is_useless
Mark Stapp [Fri, 1 Nov 2024 13:30:39 +0000 (09:30 -0400)]
Merge pull request #17329 from donaldsharp/wheel_name_is_useless

lib: Remove wheel name it is no longer used

5 months agoMerge pull request #17330 from donaldsharp/revert_ospf_asbr_status_change
Donatas Abraitis [Fri, 1 Nov 2024 08:11:13 +0000 (10:11 +0200)]
Merge pull request #17330 from donaldsharp/revert_ospf_asbr_status_change

Revert "ospfd: update ospf_asbr_status when using no_area_nssa command"

5 months agoRevert "ospfd: update ospf_asbr_status when using no_area_nssa command" 17330/head
Donald Sharp [Fri, 1 Nov 2024 01:35:51 +0000 (21:35 -0400)]
Revert "ospfd: update ospf_asbr_status when using no_area_nssa command"

This reverts commit 71aa5ab7f6f166065e3b869e3c33ba5b7a57fccb.

5 months agoMerge pull request #17327 from donaldsharp/bgp_update_optimizations
Jafar Al-Gharaibeh [Thu, 31 Oct 2024 20:06:42 +0000 (15:06 -0500)]
Merge pull request #17327 from donaldsharp/bgp_update_optimizations

Bgp update optimizations

5 months agolib: Remove counter and a function 17280/head
Donald Sharp [Mon, 28 Oct 2024 21:52:54 +0000 (17:52 -0400)]
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>
5 months agobgpd: Remove call into event_master_free_unused
Donald Sharp [Mon, 28 Oct 2024 21:51:04 +0000 (17:51 -0400)]
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>
5 months agolib: Remove wheel name it is no longer used 17329/head
Donald Sharp [Thu, 31 Oct 2024 17:55:48 +0000 (13:55 -0400)]
lib: Remove wheel name it is no longer used

With commit:
60a3efec2458d9a1531f8204d0e4a91729d3fc00

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>
5 months agoMerge pull request #17281 from nabahr/mrib-import
Donald Sharp [Thu, 31 Oct 2024 17:28:57 +0000 (13:28 -0400)]
Merge pull request #17281 from nabahr/mrib-import

Add support to import alternate URIB tables into the main MRIB

5 months agolib: In sockunion.c convert v6 memcmp's to IPV6_ADDR_CMP 17312/head
Donald Sharp [Thu, 31 Oct 2024 14:06:26 +0000 (10:06 -0400)]
lib: In sockunion.c convert v6 memcmp's to IPV6_ADDR_CMP

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agotests: Do not set by default netlink receive buffer size for Zebra 17328/head
Donatas Abraitis [Thu, 31 Oct 2024 15:00:20 +0000 (17:00 +0200)]
tests: Do not set by default netlink receive buffer size for Zebra

If we want to override this value - we can't because it's set by default to
90000000.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agozebra: fix missing kernel routes
anlan_cs [Thu, 31 Oct 2024 14:44:05 +0000 (22:44 +0800)]
zebra: fix missing kernel routes

The `rib_update_handle_kernel_route_down_possibility()` didn't consider
the kernel routes ( blackhole )  without interface.  When some other
interfaces are down, these kernel routes will be wrongly removed.

Signed-off-by: anlan_cs <anlan_cs@126.com>
5 months agobgpd: Move RFC 8212 check for inbound before filter in bgp_update 17327/head
Donald Sharp [Wed, 30 Oct 2024 20:09:01 +0000 (16:09 -0400)]
bgpd: Move RFC 8212 check for inbound before filter in bgp_update

Currently the code to check to see if any input filters are
applicable is *before* the RFC 8212 check to see if we have
any filters at all.  As such we have already tested for this,
so let's move this check for RFC 8212 to immediately before
the input filter test.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: Convert rcvd_attr_printed to a bool
Donald Sharp [Wed, 30 Oct 2024 20:00:46 +0000 (16:00 -0400)]
bgpd: Convert rcvd_attr_printed to a bool

No need for a integer to store this, use a bool

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: Refactor bgp_update some for nexthop reachability
Donald Sharp [Wed, 30 Oct 2024 19:44:12 +0000 (15:44 -0400)]
bgpd: Refactor bgp_update some for nexthop reachability

The nexthop reachability code was cut-n-pasted 2 times
with just a tiny bit of difference.  If we ever change
that it becomes `fun` to keep them in sync.  Since this
is more important than full on speed of code let's abstract
and get bgp_update() to be a bit easier to maintain.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: In bgp_update() for mac addrs ensure we are dealing with evpn
Donald Sharp [Wed, 30 Oct 2024 17:11:35 +0000 (13:11 -0400)]
bgpd: In bgp_update() for mac addrs ensure we are dealing with evpn

The code is just arbitrarily checking to see if there are any
mac addresses associated with a prefix.  This makes no
sense from the perspective that it can only happen as
an evpn route.  Let's not make non-evpn people pay
the price to check this data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: In bgp_update try to optimize is_loop_check variable
Donald Sharp [Wed, 30 Oct 2024 16:48:35 +0000 (12:48 -0400)]
bgpd: In bgp_update try to optimize is_loop_check variable

The variable is_loop_check is being set and then later
we test against it multiple times.  Move the setting
of whether or not to check for as loops to where it
is tested against and stop testing it multiple times.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: Only set bgp_labels in bgp_update if we have num_labels
Donald Sharp [Wed, 30 Oct 2024 15:14:56 +0000 (11:14 -0400)]
bgpd: Only set bgp_labels in bgp_update if we have num_labels

In the interest of speeding up code, there is no point in
attempting to see if a label is usable if the number of labels
passed in is 0.  Since that is a much much quicker test than
the bgp_is_valid_label() call, let's test that first.

Additionally, there is no point in walking the label[] array
passed in unless we are in the if statement, so move it inside.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: allowas_in and aspath_loop_count only used in one if statement
Donald Sharp [Wed, 30 Oct 2024 15:05:11 +0000 (11:05 -0400)]
bgpd: allowas_in and aspath_loop_count only used in one if statement

In bgp_update(), the two variables allowas_in and aspath_loop_count
are only used when peer->change_local_as is true.  Move the retrieval
of the allowas_in data to inside the if statement to save some
(very) small amount of time in bgp_update not gathering this
data unless the particular peer has this set.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agolib, tests: Remove in6addr_cmp function from the system
Donald Sharp [Wed, 30 Oct 2024 14:41:08 +0000 (10:41 -0400)]
lib, tests: Remove in6addr_cmp function from the system

This function should just be memcmp.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agolib: Replace usage of in6addr_cmp with memcmp
Donald Sharp [Wed, 30 Oct 2024 14:15:42 +0000 (10:15 -0400)]
lib: Replace usage of in6addr_cmp with memcmp

memcmp will return and act exactly the same as in6addr_cmp
but it does it significantly faster than how in6addr_cmp
does it.  Let this be a lesson for implementing something
that is a duplicate of what is provided by the c library.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agoMerge pull request #17317 from opensourcerouting/feature/allow_setting_custom_params_...
Jafar Al-Gharaibeh [Thu, 31 Oct 2024 13:55:23 +0000 (08:55 -0500)]
Merge pull request #17317 from opensourcerouting/feature/allow_setting_custom_params_for_daemons_unified_config

tests: Add an ability to specify daemon params with unified config

5 months agoMerge pull request #17318 from opensourcerouting/fix/add_missing_new_line_for_zebra_help
Mark Stapp [Thu, 31 Oct 2024 13:13:56 +0000 (09:13 -0400)]
Merge pull request #17318 from opensourcerouting/fix/add_missing_new_line_for_zebra_help

zebra: Add missing new line for help string

5 months agotests: Add zebra rib import-table tests 17281/head
Nathan Bahr [Tue, 29 Oct 2024 15:06:36 +0000 (15:06 +0000)]
tests: Add zebra rib import-table tests

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
5 months agoospfd: Use router_id what Zebra has if we remove a static router_id 17319/head
Donatas Abraitis [Thu, 31 Oct 2024 09:38:40 +0000 (11:38 +0200)]
ospfd: Use router_id what Zebra has if we remove a static router_id

If we set router-id, e.g. `router-id x.x.x.x`, then we have:

```
pc.donatas.net# show ip ospf | include Router ID
 OSPF Routing Process, Router ID: x.x.x.x
```

But once we remove it (`no router-id x.x.x.x`), the old router-id remains.

This is kinda OK, but to be consistent with OSPFv3 we should use what Zebra
already has, instead of retaining the old one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agoospfd: Add a hidden command for old `no router-id`
Donatas Abraitis [Thu, 31 Oct 2024 09:37:49 +0000 (11:37 +0200)]
ospfd: Add a hidden command for old `no router-id`

A new command is `ospf router-id ...`, but the old one is also valid. Just a no
form was missed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agozebra: Add missing new line for help string 17318/head
Donatas Abraitis [Thu, 31 Oct 2024 08:47:48 +0000 (10:47 +0200)]
zebra: Add missing new line for help string

```
  -A, --asic-offload        FRR is interacting with an asic underneath the linux kernel
      --v6-with-v4-nexthops Underlying dataplane supports v6 routes with v4 nexthops  -s, --nl-bufsize          Set netlink receive buffer size
```

Fixes: 1f5611c06d1c243b42279748788f0627793ead9c ("zebra: Allow zebra cli to accept v6 routes with v4 nexthops")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agotests: Add an ability to specify daemon params with unified config 17317/head
Donatas Abraitis [Thu, 31 Oct 2024 08:43:28 +0000 (10:43 +0200)]
tests: Add an ability to specify daemon params with unified config

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agoMerge pull request #17296 from LabNConsulting/liambrady/core-rlimit-respect-hard...
Donatas Abraitis [Thu, 31 Oct 2024 08:19:55 +0000 (10:19 +0200)]
Merge pull request #17296 from LabNConsulting/liambrady/core-rlimit-respect-hard-limit

tests: respect RLIMIT_CORE hard limit

5 months agoMerge pull request #17310 from opensourcerouting/fix/doc_build
Jafar Al-Gharaibeh [Wed, 30 Oct 2024 18:13:34 +0000 (13:13 -0500)]
Merge pull request #17310 from opensourcerouting/fix/doc_build

doc: Create html_context before setting READTHEDOCS

5 months agoMerge pull request #17311 from opensourcerouting/fix/syntax_topotests
Jafar Al-Gharaibeh [Wed, 30 Oct 2024 17:49:43 +0000 (12:49 -0500)]
Merge pull request #17311 from opensourcerouting/fix/syntax_topotests

doc: Use RST, not Markdown format for links

5 months agodoc: Use RST, not Markdown format for links 17311/head
Donatas Abraitis [Wed, 30 Oct 2024 12:26:07 +0000 (14:26 +0200)]
doc: Use RST, not Markdown format for links

Fixes: d155d62785 ("doc: Require unified config for all new topotests")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agodoc: Create html_context before setting READTHEDOCS 17310/head
Donatas Abraitis [Wed, 30 Oct 2024 12:15:36 +0000 (14:15 +0200)]
doc: Create html_context before setting READTHEDOCS

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/frrouting/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 529, in eval_config_file
    exec(code, namespace)  # NoQA: S102
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/frrouting/checkouts/latest/doc/user/conf.py", line 77, in <module>
    html_context["READTHEDOCS"] = True
    ^^^^^^^^^^^^
NameError: name 'html_context' is not defined

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agoMerge pull request #15563 from donaldsharp/bgp_musings
Russ White [Wed, 30 Oct 2024 10:04:45 +0000 (06:04 -0400)]
Merge pull request #15563 from donaldsharp/bgp_musings

Bgp musings

5 months agobgpd: Treat numbered community-list only if it's in a range 1-500 17305/head
Donatas Abraitis [Wed, 30 Oct 2024 08:45:28 +0000 (10:45 +0200)]
bgpd: Treat numbered community-list only if it's in a range 1-500

Before this patch, if we set something like:

```
bgp extcommunity-list expanded 1234 permit admin
```

In running config we have:

```
bgp extcommunity-list 1234 seq 5 permit admin
```

That leads to incorrect rendering, even more the line can't be deleted.

With this fix we treat numbered community-list only if it's inside the range
1-500, otherwise it's a non-numbered clist.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agodoc: Document zebra table import command with additional mrib flag
Nathan Bahr [Tue, 29 Oct 2024 03:40:55 +0000 (03:40 +0000)]
doc: Document zebra table import command with additional mrib flag

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
5 months agozebra: Add ability to import alternate tables into the MRIB
Nathan Bahr [Mon, 28 Oct 2024 18:55:49 +0000 (18:55 +0000)]
zebra: Add ability to import alternate tables into the MRIB

Expanded the cli command to include an mrib flag for importing to
the main table MRIB instead of the main table URIB.
Piped through specifying the safi through the import table functions
rather than hardcoding to SAFI_UNICAST.
Import still only import routes from the URIB subtable, only added the
ability to import into the main table MRIB.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
5 months agozebra: Deconfuse clang-sa about possible NULL pointer 17230/head
Donald Sharp [Fri, 25 Oct 2024 01:26:51 +0000 (21:26 -0400)]
zebra: Deconfuse clang-sa about possible NULL pointer

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: workaround clang-sa for set but not used value
Donald Sharp [Fri, 25 Oct 2024 01:25:47 +0000 (21:25 -0400)]
bgpd: workaround clang-sa for set but not used value

Our switch statements with a default value confuse
clang-sa 19.  Make it happy.  Just following David's
earlier commit.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: add some counters not displayed yet 15563/head
Donald Sharp [Sat, 4 Nov 2023 03:26:56 +0000 (23:26 -0400)]
bgpd: add some counters not displayed yet

Add some counters to keep track how often stuff is done.
This is mainly for us developers.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: Further extend `show bgp attribute-info`
Donald Sharp [Sat, 16 Mar 2024 01:08:43 +0000 (21:08 -0400)]
bgpd: Further extend `show bgp attribute-info`

Fill out a bit more data about what is being held.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: Optimize the usage of jhash
Donald Sharp [Sat, 16 Mar 2024 00:42:39 +0000 (20:42 -0400)]
bgpd: Optimize the usage of jhash

There are a bunch of jhash_1word uses.  Let's convert
to jhash_3word and get rid of some calls.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agonhrpd: Modify NHRP authentication feature logging 17115/head
Joshua Muthii [Tue, 29 Oct 2024 16:08:14 +0000 (12:08 -0400)]
nhrpd: Modify NHRP authentication feature logging

Modified nhrp_connection_authorized(). Initially, when writing debug
information about incoming NHRP packets with authentication enabled,
the nhrp_connection_authorized() function would print the
passphrase of the incoming packet as if it were a null terminated
string. This meant that if the passphrase on the incoming packet
had non ASCII-complient bytes in it, it would attempt to print those
bytes anyway. There was also no check that the size of the passphrase in
the incoming packet matched the size of the passphrase on the interface.
The changes in this commit log the passphrase on the incoming packet as
well as the passphrase on interface in HEX to avoid issues with ASCII.
It also performs a check that accounts for the sizes of the two different
passphrases

Moved CISCO_PASS_LENGTH_LEN from nhrp_vty.c to nhrp_protocol.h
for easier access  to the macro in other files

Signed-off-by: Joshua Muthii <jmuthii@labn.net>
5 months agonhrpd: Add topotest for retrying resolution request
Joshua Muthii [Tue, 29 Oct 2024 16:05:59 +0000 (12:05 -0400)]
nhrpd: Add topotest for retrying resolution request

Modified nhrp_topo topotest to test for newly added resolution
request retry feature. Changes to the topotest include adding a spoke to the
existing nhrp_topo topotest so that a topology with two spokes and hub
can be used to create shortcuts and test the sending/resending of
resolution requests and responses between spoke and hub. The resolution
request retry feature was tested by blocking incoming resolution requests on a
receiving nodes to stop the creation of a successful shortcut - which
then triggered the sending spoke to retry sending resolution requests

Signed-off-by: Joshua Muthii <jmuthii@labn.net>
5 months agotests: respect RLIMIT_CORE hard limit 17296/head
Liam Brady [Tue, 29 Oct 2024 12:50:17 +0000 (08:50 -0400)]
tests: respect RLIMIT_CORE hard limit

In the case that the RLIMIT_CORE hard limit cannot
be raised on a system, do not fail due to an exception.
Instead, attempt to increase the soft limit to as large
a value as possible (e.g. to the set hard limit).

Signed-off-by: Liam Brady <lbrady@labn.net>
5 months agoMerge pull request #17251 from donaldsharp/bgp_best_path_evpn_issue
Russ White [Tue, 29 Oct 2024 14:16:37 +0000 (10:16 -0400)]
Merge pull request #17251 from donaldsharp/bgp_best_path_evpn_issue

bgpd: bestpath failure when you have a singlepath not in holddown

5 months agoMerge pull request #17226 from louis-6wind/fix-bmp-tests
Russ White [Tue, 29 Oct 2024 14:12:11 +0000 (10:12 -0400)]
Merge pull request #17226 from louis-6wind/fix-bmp-tests

tests: fix bmp tests random failure

5 months agoMerge pull request #17190 from baozhen-H3C/202410180176
Russ White [Tue, 29 Oct 2024 14:08:28 +0000 (10:08 -0400)]
Merge pull request #17190 from baozhen-H3C/202410180176

isisd: The command "'show isis vrf all summary json" has no output.

5 months agoMerge pull request #16990 from lsang6WIND/label-per-nexthop
Russ White [Tue, 29 Oct 2024 14:05:37 +0000 (10:05 -0400)]
Merge pull request #16990 from lsang6WIND/label-per-nexthop

bgpd: fix prefix same as nexthop in label per nexthop

6 months agoMerge pull request #17245 from fdumontet6WIND/fix1
Donatas Abraitis [Tue, 29 Oct 2024 12:12:05 +0000 (14:12 +0200)]
Merge pull request #17245 from fdumontet6WIND/fix1

bgpd:  fix crash when polling bgp4v2PathAttrTable

6 months agoMerge pull request #17278 from pguibert6WIND/bmp_listener
Donatas Abraitis [Tue, 29 Oct 2024 08:57:05 +0000 (10:57 +0200)]
Merge pull request #17278 from pguibert6WIND/bmp_listener

bgpd: fix blank line in running-config with bmp listener cmd

6 months agoMerge pull request #17189 from Shbinging/fix_some_ospf_unset_commands_syntax
Donatas Abraitis [Tue, 29 Oct 2024 08:43:53 +0000 (10:43 +0200)]
Merge pull request #17189 from Shbinging/fix_some_ospf_unset_commands_syntax

ospfd:fix syntax of some ospf no commands

6 months agoMerge pull request #17257 from pguibert6WIND/srv6_debug
Donatas Abraitis [Tue, 29 Oct 2024 08:32:20 +0000 (10:32 +0200)]
Merge pull request #17257 from pguibert6WIND/srv6_debug

zebra: add 'debug zebra srv6' command

6 months agoMerge pull request #17254 from donaldsharp/mrib_nht_wonky
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 21:20:20 +0000 (16:20 -0500)]
Merge pull request #17254 from donaldsharp/mrib_nht_wonky

Mrib nht wonky

6 months agozebra: When installing a mroute, allow it to flow 17254/head
Donald Sharp [Sat, 26 Oct 2024 01:56:14 +0000 (21:56 -0400)]
zebra: When installing a mroute, allow it to flow

Currently the mroute code was not allowing the mroute
to be sent to the dataplane.  This leaves us with a
situation where the routes being installed where never
being set as installed and additionally nht against
the mrib would not work if the route came into existence
after the nexthop tracking was asked for.

Turns out all the pieces where there to let this work.
Modify the code to pass it to the dplane and to send
it back up as having worked.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agozebra: Add safi to some debugs
Donald Sharp [Fri, 25 Oct 2024 19:44:34 +0000 (15:44 -0400)]
zebra: Add safi to some debugs

Trying to figure out what safi we are talking about is fun when
it is not put into the debugs.

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