Commit Graph

36914 Commits

Author SHA1 Message Date
Donatas Abraitis
e63b1520f1 bgpd: Do not filter no-export community for BGP OAD (one administration domain)
OAD is treated as an _internal_ BGP peer, and some of the rules (including BGP
attributes) can be relaxed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-18 22:35:28 +03:00
Russ White
75e34c032b
Merge pull request #16452 from louis-6wind/fix-ipv4-mapped-ipv6-display
lib, test: fix display ipv4 mapped ipv6 addresses
2024-10-16 13:01:52 -04:00
Donatas Abraitis
1ce225d7e4
Merge pull request #17076 from donaldsharp/rnh_and_redistribution_nexthop_num_fix
*: Fix up improper handling of nexthops for nexthop tracking
2024-10-16 16:34:08 +03:00
Donald Sharp
cc63dbb68f
Merge pull request #17020 from pguibert6WIND/asan_shutdown
zebra: fix heap-use-after free on ns shutdown
2024-10-16 09:15:06 -04:00
Russ White
80dc863d92
Merge pull request #16946 from opensourcerouting/fix/match_src-peer
bgpd: Implement match src-peer ... command
2024-10-16 07:51:20 -04:00
Louis Scalbert
3c430cd4e0 tests: update fuzz after ipv4 mapped ipv6 print change
Update IS-IS fuzz test to match corrected output after change in the
display of IPv4 mapped IPv6 address.

The update was performed using wuschl [1] like this:

$ wuschl rebuild tests/isisd/test_fuzz_isis_tlv
$ gzip -9 tests/isisd/test_fuzz_isis_tlv_tests.h

[1] https://pypi.org/project/wuschl/

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-16 13:45:54 +02:00
Louis Scalbert
84ab0213fc lib, test: fix display ipv4 mapped ipv6 addresses
Display ipv4 mapped ipv6 addresses in the format ::ffff:A.B.C.D.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-16 13:45:46 +02:00
Donatas Abraitis
40dce0be6a
Merge pull request #17114 from Jafaral/getenv
vtysh: fix SA warning, no need to call getenv() twice
2024-10-16 10:50:02 +03:00
Donatas Abraitis
c32bdc2469
Merge pull request #17116 from enkechen-panw/zfix-2
zebra: unlock node only after operation in zebra_free_rnh()
2024-10-16 08:12:28 +03:00
Donatas Abraitis
e17bc281ef
Merge pull request #17126 from donaldsharp/ospf_lsa_declarations
ospfd: Fixup ospf_lsa.[ch] to properly spell out parameters for funct…
2024-10-16 08:10:27 +03:00
Jafar Al-Gharaibeh
df482a0f79
Merge pull request #17107 from donaldsharp/actuallY_call_the_command
tests: iproute2_check_path_selection call the actual command
2024-10-15 21:24:33 -05:00
Donald Sharp
573d807adf ospfd: Fixup ospf_lsa.[ch] to properly spell out parameters for functions
Our standard says when in a .h file and declaring a function all parameters
must have their variables spelled out.  Let's do this for ospf_lsa.h

Modified ospf_lsa.c to also use event instead of thread, and uint8_t instead
of unsigned short.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-15 18:32:14 -04:00
Russ White
de02471a8d
Merge pull request #17038 from opensourcerouting/feature/bgp_set_metric_internal
bgpd: Derive and set MED from IGP or AIGP
2024-10-15 17:58:05 -04:00
Jafar Al-Gharaibeh
b2eaf86fb5
Merge pull request #15586 from donaldsharp/nht_explain_doc
zebra: Attempt to explain the rnh tracking code better
2024-10-15 14:25:35 -05:00
Jafar Al-Gharaibeh
b23bbb885a
Merge pull request #17088 from donaldsharp/connected_kernel_fun
zebra: Prevent a kernel route from being there when a connected should
2024-10-15 14:04:51 -05:00
Russ White
5b5756911c
Merge pull request #17073 from louis-6wind/fix-ipv6-ll-nexthop-reflector
bgpd, tests: don't send local nexthop from rr client
2024-10-15 14:18:49 -04:00
Enke Chen
5b6ff51b8a zebra: unlock node only after operation in zebra_free_rnh()
Move route_unlock_node() after rnh_list_del().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2024-10-15 10:25:46 -07:00
Donald Sharp
24296c6cde
Merge pull request #17104 from opensourcerouting/frr-format-array-crash
tools/gcc-plugins: don't crash on array parameters
2024-10-15 13:22:54 -04:00
Donald Sharp
28237d73ad zebra: Attempt to explain the rnh tracking code better
I got asked today what was going on in the rnh code.  I
had to take time off of what I was doing and rewrap my
head around this code, since it's been a long time.
As that this question may come up again in the future
I am trying to document this better so that someone
coming behind us will be able to read this and get
a better idea of what the algorithm is attempting
to do.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-15 12:42:17 -04:00
Jafar Al-Gharaibeh
38661a6aa5 vtysh: fix SA warning, no need to call getenv() twice
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-10-15 11:11:03 -05:00
Donald Sharp
645a9e4f83 *: Fix up improper handling of nexthops for nexthop tracking
Currently FRR needs to send a uint16_t value for the number
of nexthops as well it needs the ability to properly decode
all of this.  Find and handle all the places that this happens.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-15 11:57:23 -04:00
Russ White
0aef4e4041
Merge pull request #17106 from louis-6wind/fix-bmp-converity
bgpd: fix bmp coverity issue 1600779
2024-10-15 11:55:42 -04:00
Russ White
f37b770a34
Merge pull request #17101 from Shbinging/fix_no_area_range_command
ospfd: fix the bug that the empty area was not free after no_area_range was executed
2024-10-15 11:20:34 -04:00
Russ White
8a50afc52b
Merge pull request #17083 from opensourcerouting/fix/openfabric_remove_redundant_check
isisd: Remove circuit state check for openfabric
2024-10-15 11:17:02 -04:00
Russ White
884e183f4a
Merge pull request #17058 from opensourcerouting/fix/apply_route_maps_earlier
lib: Apply and generate route-map commands earlier before any other protocol
2024-10-15 11:15:41 -04:00
Russ White
a481d93941
Merge pull request #17053 from opensourcerouting/fix/drop_bgp_network_import_check_exact_cmd
bgpd: Drop deprecated `bgp network import-check exact` command
2024-10-15 11:14:35 -04:00
Donatas Abraitis
a593f156d7 tests: Check if underlay IGP metric is reflected into BGP after cost changes
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-15 17:42:53 +03:00
Donatas Abraitis
b924f03387 bgpd: Re-announce the routes if the underlay IGP metric changes
If the underlay IGP metric changes, we SHOULD re-announce the routes with the
correct bpi->extra->igpmetric set.

Without this patch if the IGP link cost (metric) changes, we never notice this
and the peers do not have the updated metrics, which in turn causes incorrect
best path selections on remote peers.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-15 17:42:53 +03:00
Donatas Abraitis
7cdece8c84 doc: Add set metric aigp command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-15 17:42:52 +03:00
Donatas Abraitis
3105ceaee9 tests: Check if set metric aigp works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-15 17:42:52 +03:00
Donatas Abraitis
e94f48498d bgpd: Implement set metric aigp command
Same as `set metric igp`, but in this case accumulated IGP metric is being
sent as MED attribute.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-15 17:42:52 +03:00
Donatas Abraitis
8d39cfd613 tests: Check if MED can be derived from set metric igp|aigp
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-15 17:42:51 +03:00
Donatas Abraitis
f677fc8db3 bgpd: Implement set metric igp command
Set metric automatically from the path info (IGP protocol).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-15 17:36:51 +03:00
Donatas Abraitis
5a05dbeb13 bgpd: Set MED using a helper bgp_attr_set_med()
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-15 17:36:50 +03:00
Donatas Abraitis
ecb7b78d30
Merge pull request #17093 from enkechen-panw/aigp-fix2
bgpd: fix route selection with AIGP
2024-10-15 17:23:04 +03:00
Donald Sharp
c8a947e12b tests: iproute2_check_path_selection call the actual command
For some reason this was missing.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-15 09:51:08 -04:00
Louis Scalbert
2a54ddb7fc bgpd: fix bmp coverity issue 1600779
Fix bmp coverity issue 1600779. peer->su_local cannot be NULL.

Fixes: 035304c25a ("bgpd: bmp loc-rib peer up/down for vrfs")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-15 15:43:41 +02:00
Mark Stapp
00e8609e6f
Merge pull request #17103 from opensourcerouting/fix/null_ptr_dereference_bmp_bgp
bgpd: Check if su_local/su_remote exist before encoding BMP peer state
2024-10-15 08:24:54 -04:00
Mark Stapp
8936108769
Merge pull request #17099 from opensourcerouting/fix/remove_BGP_NEXTHOP_CONNECTED_CHANGED
bgpd: Remove unused BGP_NEXTHOP_CONNECTED_CHANGED flag for nexthop
2024-10-15 08:24:22 -04:00
Mark Stapp
6c1bc51bbb
Merge pull request #16737 from raja-rajasekar/rajasekarr/vlan_to_dplane
zebra: vlan to dplane
2024-10-15 08:06:34 -04:00
David Lamparter
070ce19d0c tools/gcc-plugins: don't crash on array parameters
Need to have arrays as a stop condition in this type normalization
function, like pointers and function pointers.  Actual arrays as
argument types are extremely rare to see because C has this
array-decay-to-pointer thing, but it can happen.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-10-15 13:35:24 +02:00
Donatas Abraitis
e15eb6a089 bgpd: Check if su_local/su_remote exist before encoding BMP peer state
Fixes: 035304c25a ("bgpd: bmp loc-rib peer up/down for vrfs")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-15 12:51:51 +03:00
Donatas Abraitis
a2e226b44e bgpd: Remove unused BGP_NEXTHOP_CONNECTED_CHANGED flag for nexthop
Also reduce the size of change_flags, which is way enough to be 1 byte.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-15 12:43:38 +03:00
Shbinging
af0d1355c7 ospfd:fix the bug that the empty area was not free after the command was executed
When we use the no area X.X.X.X range A.B.C.D/M command, if the area no longer has an interface to which it belongs, then the area should be deleted from the LSDB. This processing logic is consistent with instructions such as no network area and no area authentication.

Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-10-15 08:10:52 +00:00
Donatas Abraitis
5c194b3639
Merge pull request #17001 from louis-6wind/bmp-new
bgpd: bmp loc-rib peer up/down for vrfs
2024-10-15 09:09:42 +03:00
Donatas Abraitis
f0d93a41cc
Merge pull request #17087 from louis-6wind/fix-as-override
doc: clarify bgp as-override
2024-10-15 08:54:49 +03:00
Donatas Abraitis
03b4d1a2ad
Merge pull request #17074 from chiragshah6/evpn_dev4
bgpd: fix evpn mh esi down
2024-10-15 08:20:54 +03:00
Enke Chen
1ee7e63a6c tests: fix and adjust topotest/bgp_aigp
Fix and adjust the topotest post the fix for route selection with
AIGP.

When there are multiple	IGP domains (OSPF in this case), the nexthop
for a BGP route with the AIGP attribute must be resolved in its own
IGP domain.

The changes in r2/bgpd.conf and r3/bgpd.conf are needed as incorrect
IGP metrics are received from NHT for the recursive nexthops. Once
the issue is resolved, the changes can be reverted.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2024-10-14 18:54:07 -07:00
Enke Chen
081422e8e7 bgpd: fix route selection with AIGP
The nexthop metric should be added to AIGP when calculating the
bestpath in bgp_path_info_cmp().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2024-10-14 18:45:06 -07:00
Chirag Shah
3f00709a39 bgpd: fix evpn mh esi flap remove local routes
In symmetric routing, when local ESI is down,
the MH peer learnt local mac-ip
prefix is installed into teannt vrf (given l3vni).

When ESI is back up and associated to evi/vni then
remove the local synced mac-ip imported routes from the
tenant vrf as local neigh/arp is present.

Ticket: #3878699
Testing:

peer advertised mac-ip route:
*> [2]:[0]:[48]:[aa:aa:aa:00:00:01]:[32]:[45.0.0.51] RD 27.0.0.4:9
                    27.0.0.4 (spine-1)
                                                           0 64435 65016 i
                    ESI:03:44:38:39:ff:ff:01:00:00:01
                    RT:65016:1000 RT:65016:4000 ET:8 Rmac:44:38:39:ff:ff:16

When local ESI is flapped
torm-11:# ip neigh show 45.0.0.51
45.0.0.51 dev vlan1000 lladdr aa:aa:aa:00:00:01 REACHABLE proto zebra

Before fix:
(The imported route remained in tenant-vrf)
torm-11:# ip route show vrf vrf1 45.0.0.51
45.0.0.51 nhid 257 proto bgp metric 20

After fix:

torm-11# ip route show vrf vrf1 45.0.0.51
torm-11#

trace:
2024/10/11 18:19:29 BGP: [JMP3T-178G8] route [2]:[0]:[48]:[00:02:00:00:00:08]:[32]:[21.1.0.5]
is matched on local esi 03:00:00:00:77:01:04:00:00:0e, uninstall from VRF tenant1 route table

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2024-10-14 10:09:57 -07:00