Commit Graph

37380 Commits

Author SHA1 Message Date
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
Louis Scalbert
91512c3048 bgpd: split nexthop-local unchanged peer subgroup
5bb99ccad2 ("bgpd: reset ipv6 invalid link-local nexthop") now resets
the link-local when originating and destination peers are not on the
same network segment. However, it does not work all the time.

The fix compares the 'from' and 'peer' global IPv6 address. However,
'peer' refers to one of the peers of subgroup. The subgroup may contain
peers located on different network segment.

Split nexthop-local unchanged peer subgroup by network segment.

Fixes: 5bb99ccad2 ("bgpd: reset ipv6 invalid link-local nexthop")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-11 14:07:46 +02:00
Louis Scalbert
da7b2d9831 tests: unset r3 enforce-first-as bgp_route_server_client
Unset enforce-first-as on r3 of bgp_route_server_client to enable the
reception of routes on this router.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-11 14:07:37 +02:00
Louis Scalbert
dd135843ad tests: rework bgp_route_server_client
Rework bgp_route_server_client in a more standard form in order to
facilitate the next commut changes. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-11 14:07:09 +02:00
Donald Sharp
adc0f004cf
Merge pull request #17059 from opensourcerouting/fix/move_match_ipv6_next-hop_acl_to_routemap_lib
bgpd: Move some non BGP-specific route-map functions to lib
2024-10-11 07:14:51 -04:00
Donald Sharp
554901139c
Merge pull request #17064 from rudis/master
doc: routemap: fix typos
2024-10-11 07:13:59 -04:00
Shbinging
972308b174 ospfd: fix no_area_range_cost_NUM command, NUM can be omitted
Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-10-11 09:52:16 +00:00
Simon Ruderich
8e818bf76c doc: routemap: fix typos
Signed-off-by: Simon Ruderich <simon@ruderich.org>
2024-10-11 08:34:26 +02:00
Donatas Abraitis
813a9f6e39
Merge pull request #17037 from louis-6wind/fix-ipv6-ll-nexthop
bgpd: fix ipv6 nexthop-local unchanged
2024-10-11 08:36:14 +03:00
Donatas Abraitis
997f710df2
Merge pull request #17061 from Jafaral/10.3-dev
10.3 dev deb/rpm housekeeping
2024-10-11 08:24:06 +03:00
Donatas Abraitis
279735fd95
Merge pull request #17040 from sri-mohan1/srib-24-frr-a
bgpd: changes for code maintainability
2024-10-11 08:19:44 +03:00
Jafar Al-Gharaibeh
b1e5a6fb1d
Merge pull request #17057 from donaldsharp/bgp_graceful_restart_vrf
bgpd: Allow specification of vrf in show bgp neighbor graceful-restart
2024-10-10 19:39:10 -05:00
Donald Sharp
1014901021
Merge pull request #17044 from baozhen-H3C/202410091476
isisd: Lsp fragments will delete the corresponding dyn_cache entry.
2024-10-10 18:41:27 -04:00
Jafar Al-Gharaibeh
426a566cb6 debian, redhat: frr dev 10.3 package housekeeping
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-10-10 15:44:30 -05:00
Jafar Al-Gharaibeh
400cc7055a debian, redhat: updating changelog for 10.1 release
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-10-10 15:32:38 -05:00
sri-mohan1
c853c8d13b bgpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2024-10-10 23:23:20 +05:30