Commit Graph

37295 Commits

Author SHA1 Message Date
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
Donald Sharp
74e25198e7 zebra: Prevent a kernel route from being there when a connected should
There exists a series of events where a kernel route is learned
first( that happens to be exactly what a connected route should be )
and FRR ends up with both a kernel route and a connected route,
leaving us in a very strange spot.  This code change just mirrors
the existing code of if there is a connected route drop the kernel
route.  Here we just do the reverse, if we have a kernel route
already and a connected should be created, remove the kernel and
keep the connected.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-14 11:27:53 -04:00
Louis Scalbert
2ac4c3e58d tests: fix bgp_as_override number of routers
There is only 4 routers not 6.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-14 14:39:00 +02:00
Louis Scalbert
89c6422585 doc: clarify bgp as-override
Clarify bgp as-override

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-14 14:37:59 +02:00
Louis Scalbert
c4a8263628 bgpd, tests: don't send local nexthop from rr client
AS 65000  | AS 65001
          |
      RR  |
       |  |
R1 --- | --- R2
          |

When r1 peer is an iBGP route reflector client of rr and r2 peer is a
eBGP neighbor of rr, and all three routers shares the same network, r2
receives announcements coming from r1 with a IPv6 link-local nexthop
from rr. This is incorrect as r2 should send traffic to r1 without
involving rr.

Do not send an IPv6 link-local nexthop if the originating peer is a
route-reflector client.

Link: https://github.com/FRRouting/frr/pull/16219#issuecomment-2397425505
Link: https://github.com/FRRouting/frr/pull/17037#discussion_r1792529683
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-14 10:06:35 +02:00
Louis Scalbert
4ae65cc21e bgpd: rename reflect in subgroup_announce_check
In subgroup_announce_check(), the variable reflect is misleading, as it
suggests a relation to route reflection. However, it actually refers to
the scenario where an iBGP peer announces a route to another iBGP peer.

Rename reflect to ibgp_to_ibgp.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-14 10:06:35 +02:00
Donatas Abraitis
d1433ee9a8
Merge pull request #17062 from donaldsharp/dplane_fpm_nl_problems
zebra: Only notify dplane work pthread when needed
2024-10-14 08:14:34 +03:00
Donatas Abraitis
c45e1066a2
Merge pull request #17082 from anlancs/zebra/add-debug-flags-fix
zebra: add back one field for debug
2024-10-14 08:12:40 +03:00
Donatas Abraitis
a880bfaab2 isisd: Remove circuit state check for openfabric
If we have something like:

```
int eth1
 ip router openfabric x
 ipv6 router openfabric x
```

And eth1 is removed, the first `ip router ...` fails and only `ipv6 router ...`
is enabled.

If we leave only:

```
int eth1
 ipv6 router openfabric x
```

Then also, no interface is going to be enabled, which is weird too.

Fixes: https://github.com/FRRouting/frr/issues/17075

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-13 19:54:08 +03:00
anlan_cs
05e2472de7 zebra: add back one field for debug
The `flags` field is removed recently, so add back it for debug.

Signed-off-by: anlan_cs <anlan_cs@126.com>
2024-10-13 21:30:46 +08:00
Donatas Abraitis
129c652ff1
Merge pull request #17071 from louis-6wind/fix-ipv6-ll-nexthop-unchanged
bgpd: split nexthop-local unchanged peer subgroup
2024-10-13 14:16:54 +03:00
Donald Sharp
cf2624a993 fpm: Allow max fpm message size to float based on ecmp
Currently the max message size is 4k.  With a 256 way
ecmp FRR is seeing message sizes that are in the
6k size.  There is desire to allow this to increase as
well to 512.  Since the multipath size directly effects
how big the message may be when sending the routes ecmp
let's give a bit of headroom for this value when compiling
FRR at greater sizes.  Additionally since we know not everyone
is using such large ecmp, allow them to build as appropriate
for their use cases.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-11 09:37:37 -04:00
Donald Sharp
8aa97a439f zebra: Slow down fpm_process_queue
When the fpm_process_queue has run out of space
but has written to the fpm output buffer, schedule
it to wake up immediately, as that the write will go out
pretty much immediately, since it was scheduled first.
If the fpm_process_queue has not written to the output
buffer then delay the processing by 10 milliseconds to
allow a possibly backed up write processing to have a
chance to complete it's work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-11 09:37:37 -04:00
Donald Sharp
963792e8c5 zebra: Only notify dplane work pthread when needed
The fpm_nl_process function was getting the count
of the total number of ctx's processed.  This leads
to after having processed 1 context to always signal
the dataplane that there is work to do.  Change the
code to only notify the dplane worker when a context
was actually added to the outgoing context queue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-11 09:37:37 -04:00
Louis Scalbert
7bccb8d380 topotest: add bgp_bmp_vrf topotest
Add test to check BMP in VRF.

Note that the following configuration works with interface r1-eth0
towards 192.0.2.10 (BMP collector) in the default VRF but not in vrf1.

> router bgp 65501 vrf vrf1
>  bmp targets bmp1
>   bmp connect 192.0.2.10 port 1789 min-retry 100 max-retry 10000

Also, for some reasons, the test works even without "bgpd: bmp loc-rib
peer up/down for vrfs" commit.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-11 15:14:57 +02:00
Louis Scalbert
0430d6f70b topotests: check for bmp peer up/down messages
Check for bmp peer up / down  messages

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-11 15:14:56 +02:00
Louis Scalbert
d8bfd04e46 topotests: add peer down log in bmp collector
Add peer down log in bmp collector

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-11 15:14:34 +02:00
Louis Scalbert
1de5015b09 topotests: log bmp peer up message type in collector
Log "peer up" message type in BMP collector logs.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-11 15:14:21 +02:00
Maxence Younsi
035304c25a bgpd: bmp loc-rib peer up/down for vrfs
added bmp bgp peer for vrfs
added peer up vrf in bmp peer up state
added vrf state in bmpbgp
added safe bmp_peer_sendall : bmp_peer_sendall_safe
changed bgp_open_send to call new bgp_open_make
bgp_open_make creates a bgp open packet, now used in bmp for peer up vrf
added hook and call to bgp instance state
vrf peer state is recomputed when interfaces (including vrf itf) go up / down
and when it gets created or removed

Link: e48ba38070
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
2024-10-11 15:14:12 +02:00
Louis Scalbert
33189510e8 topotests: check export labels to pre-policy bmp
Check export labels to pre-policy bmp

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-11 15:10:24 +02:00
Louis Scalbert
1005c14768 tests: test nexthop-local unchanged with reflector
Test nexthop-local unchanged with route-reflector.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-11 14:08:12 +02:00
Louis Scalbert
5f035edf25 tests: test nexthop-local unchanged with route-server
Test nexthop-local unchanged with route-server.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-11 14:07:52 +02:00