Commit Graph

37147 Commits

Author SHA1 Message Date
Donatas Abraitis
a85dce2c66
Merge pull request #17341 from zice312963205/zly_tcpmss
bgpd:support tcp-mss for neighbor group
2024-11-08 09:11:41 +02:00
Donatas Abraitis
af9a2cb875
Merge pull request #17231 from guoguojia2021/guozhongfeng_alibaba
bgpd:support of color extended community color-only types
2024-11-08 08:56:21 +02:00
Russ White
68ec006481
Merge pull request #12109 from donaldsharp/routemap_time_spent
lib: Add ability to track time in individual routemaps
2024-11-07 13:19:11 -05:00
Donald Sharp
36abc43cfc
Merge pull request #17376 from opensourcerouting/fix/stale_routes_with_addpath
bgpd: Clear stale routes with multiple paths
2024-11-07 11:04:56 -05:00
Donatas Abraitis
846af511f4
Merge pull request #17244 from donaldsharp/high_ecmp_test
tests: Add a topology that supports a large number of ecmp
2024-11-07 17:15:24 +02:00
Donatas Abraitis
2e5e3b4bd0 tests: Check if stale routes with addpath are marked with LLGR community
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-11-07 14:15:18 +02:00
Donatas Abraitis
444bdc4cc0 tests: Check if routes with addpath are cleared if they are stale
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-11-07 14:05:36 +02:00
Donatas Abraitis
895d586a5f 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: 1479ed2fb3 ("bgpd: Implement LLGR helper mode")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-11-07 14:05:36 +02:00
Donatas Abraitis
7de464b00f 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>
2024-11-07 14:05:35 +02:00
guozhongfeng.gzf
812dcc44d3 doc:the doc of extcomumnity color
Signed-off-by: guozhongfeng.gzf <guozhongfeng.gzf@alibaba-inc.com>
2024-11-07 19:02:21 +08:00
guozhongfeng.gzf
5a28b620d3 tests:support of color extended community color-only types
Signed-off-by: guozhongfeng.gzf <guozhongfeng.gzf@alibaba-inc.com>
2024-11-07 19:02:21 +08:00
guozhongfeng.gzf
937cf4db17 bgpd:support of color extended community color-only types
Add support of color extended community color-only types, RFC 9256.
The type only support 00 01 10.

configuration example:
!
frr version 10.3-dev-my-manual-build
frr defaults traditional
hostname router3
!
route-map color permit 1
 set extcommunity color 10:100 01:200 00:300
exit
!
vrf Vrf1
exit-vrf
!
interface lo
 ipv6 address 3::3/128
exit
!
router bgp 3
 bgp router-id 3.3.3.3
 bgp log-neighbor-changes
 no bgp ebgp-requires-policy
 no bgp default ipv4-unicast
 bgp bestpath as-path multipath-relax
 timers bgp 10 30
 neighbor 100.13.13.1 remote-as 1
 neighbor 100.13.13.1 advertisement-interval 0
 neighbor 100.23.23.2 remote-as 2
 neighbor 100.23.23.2 advertisement-interval 0
 neighbor 1000:3000::1 remote-as 1
 neighbor 1000:3000::1 ebgp-multihop
 neighbor 1000:3000::1 update-source 1000:3000::3
 neighbor 1000:3000::1 capability extended-nexthop
 neighbor 2000:3000::2 remote-as 2
 neighbor 2000:3000::2 ebgp-multihop
 neighbor 2000:3000::2 update-source 2000:3000::3
 neighbor 2000:3000::2 capability extended-nexthop
 !
 address-family ipv4 unicast
  neighbor 100.13.13.1 activate
  neighbor 100.23.23.2 activate
 exit-address-family
 !
 address-family ipv6 unicast
  redistribute connected route-map color
  neighbor 1000:3000::1 activate
  neighbor 2000:3000::2 activate
 exit-address-family
exit
!
end

Signed-off-by: guozhongfeng.gzf <guozhongfeng.gzf@alibaba-inc.com>
2024-11-07 19:02:11 +08:00
hanyu.zly
9fa56a03c7 bgpd:support tcp-mss for neighbor group
Signed-off-by: hanyu.zly <hanyu.zly@alibaba-inc.com>
2024-11-07 14:50:21 +08: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
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