Commit graph

37295 commits

Author SHA1 Message Date
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
Donatas Abraitis 247a75d5c6 bgpd: Reset BGP session only if it was a real BFD DOWN event
Without this patch we always see a double-reset, e.g.:

```
2024/11/04 12:42:43.010 BGP: [VQY9X-CQZKG] bgp_peer_bfd_update_source: address [0.0.0.0->172.18.0.3] to [172.18.0.2->172.18.0.3]
2024/11/04 12:42:43.010 BGP: [X8BD9-8RKN4] bgp_peer_bfd_update_source: interface none to eth0
2024/11/04 12:42:43.010 BFD: [MSVDW-Y8Z5Q] ptm-del-dest: deregister peer [mhop:no peer:172.18.0.3 local:0.0.0.0 vrf:default cbit:0x00 minimum-ttl:255]
2024/11/04 12:42:43.010 BFD: [NYF5K-SE3NS] ptm-del-session: [mhop:no peer:172.18.0.3 local:0.0.0.0 vrf:default] refcount=0
2024/11/04 12:42:43.010 BFD: [NW21R-MRYNT] session-delete: mhop:no peer:172.18.0.3 local:0.0.0.0 vrf:default
2024/11/04 12:42:43.010 BGP: [P3D3N-3277A] 172.18.0.3 [FSM] Timer (routeadv timer expire)
2024/11/04 12:42:43.010 BFD: [YA0Q5-C0BPV] control-packet: no session found [mhop:no peer:172.18.0.3 local:172.18.0.2 port:11]
2024/11/04 12:42:43.010 BFD: [MSVDW-Y8Z5Q] ptm-add-dest: register peer [mhop:no peer:172.18.0.3 local:172.18.0.2 vrf:default cbit:0x00 minimum-ttl:255]
2024/11/04 12:42:43.011 BFD: [PSB4R-8T1TJ] session-new: mhop:no peer:172.18.0.3 local:172.18.0.2 vrf:default ifname:eth0
2024/11/04 12:42:43.011 BGP: [Q4BCV-6FHZ5] zclient_bfd_session_update: 172.18.0.2/32 -> 172.18.0.3/32 (interface eth0) VRF default(0) (CPI bit no): Down
2024/11/04 12:42:43.011 BGP: [MKVHZ-7MS3V] bfd_session_status_update: neighbor 172.18.0.3 vrf default(0) bfd state Up -> Down
2024/11/04 12:42:43.011 BGP: [HZN6M-XRM1G] %NOTIFICATION: sent to neighbor 172.18.0.3 6/10 (Cease/BFD Down) 0 bytes
2024/11/04 12:42:43.011 BGP: [QFMSE-NPSNN] zclient_bfd_session_update:   sessions updated: 1
2024/11/04 12:42:43.011 BGP: [ZWCSR-M7FG9] 172.18.0.3 [FSM] BGP_Stop (Established->Clearing), fd 22
```

Reset is due to the source address change.

With this patch, we reset the session only if it's a _REAL_ BFD down event, which
means we trigger session reset if BFD session is established earlier than BGP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-11-05 20:07:30 +02:00
Donald Sharp 3e3a666331 lib: Add ability to track time in individual routemaps
Add the abilty to track how much time is spent in routemaps.
Example of the new output:

eva# show route-map
ZEBRA:
route-map: FOO Invoked: 1000000 (323 milliseconds total) Optimization: enabled Processed Change: false
 deny, sequence 10 Invoked 1000000 (320 milliseconds total)
  Match clauses:
  Set clauses:
  Call clause:
  Action:
    Exit routemap

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-11-05 12:33:05 -05: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
Donald Sharp bee1bcfd01 tests: Add a topology that supports a large number of ecmp
Add a basic topology that allows the testing of BGP and zebra
at scale.  I built this to help me find and fix problems with
a large number of bgp peers.  Since I plan to keep using this
and as I understand it there are future plans to take this
higher, I would like to add this as a test that people can invoke
with this command:

sudo -E python3 -m pytest -s -vv --topology-only

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-11-05 10:19:39 -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
Donald Sharp ff9781ebf5 lib: In sockunion.c convert v6 memcmp's to IPV6_ADDR_CMP
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 11:13:34 -04:00
Donatas Abraitis 6dc03df8cb 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>
2024-10-31 17:00:20 +02:00