]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
5 months agotests: Check if GR settings are inherited for peer-groups 17517/head
Donatas Abraitis [Mon, 25 Nov 2024 08:40:28 +0000 (10:40 +0200)]
tests: Check if GR settings are inherited for peer-groups

Convert to unified config also.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit a4bfa8c574e8ea6f1b8c6035b071a35e8d3d3f08)

5 months agobgpd: Use gracefulRestart JSON field
Donatas Abraitis [Mon, 25 Nov 2024 08:42:16 +0000 (10:42 +0200)]
bgpd: Use gracefulRestart JSON field

Deprecate gracefulRestartCapability which is inconsistent with an existing
format if advertised and received are printed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit ee5893ff598a72e3a9bf4d2f6a9bd43f833defa6)

5 months agobgpd: Fix graceful-restart for peer-groups
Donatas Abraitis [Sun, 24 Nov 2024 19:57:19 +0000 (21:57 +0200)]
bgpd: Fix graceful-restart for peer-groups

Slipped somehow that peer-groups with GR is just completely broken, but it was
working before.

Strikes again, that we MUST have more and more topotests.

Fixes: 15403f521a12b668e87ef8961c78e0ed97c6ff92 ("bgpd: Streamline GR config, act on change immediately")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 0a85b1ba04f6463e300aa6d5e064a5e5d79bec53)

5 months agoMerge pull request #17488 from FRRouting/mergify/bp/stable/10.2/pr-17487
Donald Sharp [Fri, 22 Nov 2024 23:33:59 +0000 (18:33 -0500)]
Merge pull request #17488 from FRRouting/mergify/bp/stable/10.2/pr-17487

bgpd: Do not reset peers on suppress-fib toggling (backport #17487)

5 months agobgpd: Do not reset peers on suppress-fib toggling 17488/head
Donatas Abraitis [Fri, 22 Nov 2024 08:30:37 +0000 (10:30 +0200)]
bgpd: Do not reset peers on suppress-fib toggling

If the desired state is the same - do nothing instead of resetting once again.

Fixes: bdb5ae8bce94432eb5e581f04f48dc4aa5db7ca4 ("bgpd: Make suppress-fib-pending clear peering")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 7fb4c03f5b1c9cd4e8acb85b4cf953ac85aa0bbf)

5 months agoMerge pull request #17470 from FRRouting/mergify/bp/stable/10.2/pr-17464
Jafar Al-Gharaibeh [Thu, 21 Nov 2024 03:53:47 +0000 (21:53 -0600)]
Merge pull request #17470 from FRRouting/mergify/bp/stable/10.2/pr-17464

bfdd: retain remote dplane client socket (backport #17464)

5 months agobfdd: retain remote dplane client socket 17470/head
Mark Stapp [Tue, 19 Nov 2024 19:54:06 +0000 (14:54 -0500)]
bfdd: retain remote dplane client socket

When using bfd in remote-dataplane client mode, don't close
a new client socket if we're going to try to use it.

Signed-off-by: Mark Stapp <mjs@cisco.com>
(cherry picked from commit f5115307888dc8ca4b6369d1b705686d3c689d23)

5 months agoMerge pull request #17446 from opensourcerouting/fix/backport_65a43b57efd60c4fdf80c93...
Jafar Al-Gharaibeh [Wed, 20 Nov 2024 05:27:54 +0000 (23:27 -0600)]
Merge pull request #17446 from opensourcerouting/fix/backport_65a43b57efd60c4fdf80c935750046ba861ec79f_10.2

bgpd: Validate both nexthop information (NEXTHOP and NLRI) (backport)

5 months agoMerge pull request #17437 from FRRouting/mergify/bp/stable/10.2/pr-17432
Donatas Abraitis [Tue, 19 Nov 2024 21:47:55 +0000 (22:47 +0100)]
Merge pull request #17437 from FRRouting/mergify/bp/stable/10.2/pr-17432

bgpd : backpressure - Fix to pop items off zebra_announce FIFO for few EVPN triggers (backport #17432)

5 months agobgpd: Validate both nexthop information (NEXTHOP and NLRI) 17446/head
Donatas Abraitis [Sun, 17 Nov 2024 09:16:05 +0000 (11:16 +0200)]
bgpd: Validate both nexthop information (NEXTHOP and NLRI)

If we receive an IPv6 prefix e.g.: 2001:db8:100::/64 with nextop: 0.0.0.0, and
mp_nexthop: fc00::2, we should not treat this with an invalid nexthop because
of 0.0.0.0. We MUST check for MP_REACH attribute also and decide later if we
have at least one a valid nexthop.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit a0d2734e879f78fbef5f1815429de331b9940c73)

5 months agobgpd : backpressure - Fix to pop items off zebra_announce FIFO for few EVPN triggers 17437/head
Rajasekar Raja [Thu, 14 Nov 2024 07:09:55 +0000 (23:09 -0800)]
bgpd : backpressure - Fix to pop items off zebra_announce FIFO for few EVPN triggers

In cases such as 'no advertise-all-vni' and L2 VNI DELETE, we need to
pop all the VPN routes present in the bgp_zebra_announce FIFO yet to
be processed regardless of VNI is configured or not.

NOTE: NO need to pop the VPN routes in two cases
 1) In free_vni_entry
   - Called by bgp_free()->bgp_evpn_cleanup().
   - Since bgp_delete is called before bgp_free and we pop all the dest
     pertaining to bgp under delete.
 2) evpn_delete_vni() when user configures "no vni" since the withdraw
    of all routes happen in normal cycle.

Fixes: a07df6f7548f6bd1b92acbb7a10c3823de33fe5f
("bgpd : backpressure - Handle BGP-Zebra(EPVN) Install evt Creation")

Ticket :#4163611

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit 898852f2699887bc92e96267cb3fcf221a3df01e)

5 months agoFRR Release 10.2 docker/10.2.0 frr-10.2
Jafar Al-Gharaibeh [Tue, 12 Nov 2024 15:59:48 +0000 (09:59 -0600)]
FRR Release 10.2

New Features Highlight:

- PIM candidate BSR/RP [#16438]
- Static IGMP join without an IGMP report [1#6450]
- PIM AutoRP discovery/announcements [#16634]
- IGMP proxy [#16861]
- SRv6 SID Manager [#15604]
- Add `bgp ipv6-auto-ra` command [#16354]
- Implement `neighbor x remote-as auto` for BGP [#16345]
- Implement `bgp dual-as` for BGP [#16816]
- Implement BGP-wide configuration for graceful restart [#16099]
- Handle kernel routes appropriately (should fix recent NOPREFIXROUTE issue) [#16300]
- Add `cisco-authentication` password support for NHRP [#16172]

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
5 months agodebian, redhat: updating changelog for 10.2 release
Jafar Al-Gharaibeh [Tue, 12 Nov 2024 15:54:02 +0000 (09:54 -0600)]
debian, redhat: updating changelog for 10.2 release

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
5 months agoMerge pull request #17411 from FRRouting/mergify/bp/stable/10.2/pr-17409
Russ White [Tue, 12 Nov 2024 15:03:45 +0000 (10:03 -0500)]
Merge pull request #17411 from FRRouting/mergify/bp/stable/10.2/pr-17409

bgpd: fix resolvedPrefix in show nexthop json output (backport #17409)

5 months agobgpd: fix resolvedPrefix in show nexthop json output 17411/head
Krishnasamy R [Mon, 11 Nov 2024 09:59:31 +0000 (01:59 -0800)]
bgpd: fix resolvedPrefix in show nexthop json output

While populating  the nexthop info for "show bgp nexthop json", resolvedPrefix
is added in parent json object instead of json_nexthop object.
This results in displaying wrong resolvedPrefix for nexthops.
Fixing the same by adding resolvedPrefix to json_nexthop object, so that
the proper resolvedPrefix would be displayed for the respective nexthop

Signed-off-by: Krishnasamy R <krishnasamyr@nvidia.com>
(cherry picked from commit 95c08e082c063374cbc62dea6529c8f54b0722df)

5 months agoMerge pull request #17397 from FRRouting/mergify/bp/stable/10.2/pr-17362
Donatas Abraitis [Sun, 10 Nov 2024 17:13:14 +0000 (19:13 +0200)]
Merge pull request #17397 from FRRouting/mergify/bp/stable/10.2/pr-17362

bgpd: Fix for match source-protocol in route-map for redistribute cmd (backport #17362)

5 months agobgpd: Fix for match source-protocol in route-map for redistribute cmd 17397/head
Rajasekar Raja [Mon, 21 Oct 2024 17:53:27 +0000 (10:53 -0700)]
bgpd: Fix for match source-protocol in route-map for redistribute cmd

A redistribute cmd can have a route-map attached to it and adding the
match source-protocol to that route-map means BGP to filter which
protocol routes to accept among the bunch of routes zebra is sending.

Fixing this since this wasnt implemented earlier.

Ticket :#4119692

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit 68358c0f928eafe50c9e73b0cb6a443c03f2a33f)

5 months agoMerge pull request #17387 from FRRouting/mergify/bp/dev/10.2/pr-17341
Donald Sharp [Fri, 8 Nov 2024 16:14:03 +0000 (11:14 -0500)]
Merge pull request #17387 from FRRouting/mergify/bp/dev/10.2/pr-17341

bgpd:support tcp-mss for neighbor group (backport #17341)

5 months agobgpd:support tcp-mss for neighbor group 17387/head
hanyu.zly [Mon, 4 Nov 2024 08:21:09 +0000 (16:21 +0800)]
bgpd:support tcp-mss for neighbor group

Signed-off-by: hanyu.zly <hanyu.zly@alibaba-inc.com>
(cherry picked from commit 9fa56a03c7568cb9b74f31386baef5252c5b66ce)

5 months agoMerge pull request #17378 from FRRouting/mergify/bp/dev/10.2/pr-17376
Donald Sharp [Thu, 7 Nov 2024 19:12:32 +0000 (14:12 -0500)]
Merge pull request #17378 from FRRouting/mergify/bp/dev/10.2/pr-17376

bgpd: Clear stale routes with multiple paths (backport #17376)

5 months agotests: Check if stale routes with addpath are marked with LLGR community 17378/head
Donatas Abraitis [Thu, 7 Nov 2024 12:01:39 +0000 (14:01 +0200)]
tests: Check if stale routes with addpath are marked with LLGR community

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 2e5e3b4bd097dc5b45dee476d844bde398ebee00)

5 months agotests: Check if routes with addpath are cleared if they are stale
Donatas Abraitis [Thu, 7 Nov 2024 11:17:12 +0000 (13:17 +0200)]
tests: Check if routes with addpath are cleared if they are stale

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 444bdc4cc04908fbda08114fd2f845b3be088e01)

5 months agobgpd: Set LLGR stale routes for all the paths including addpath
Donatas Abraitis [Thu, 7 Nov 2024 11:08:35 +0000 (13:08 +0200)]
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: 1479ed2fb35f4a5ae1017201a7ee37ba2727163a ("bgpd: Implement LLGR helper mode")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 895d586a5f4a15be0475296d7a5a374927d17dad)

5 months agobgpd: Clear all paths including addpath once GR expires
Donatas Abraitis [Thu, 7 Nov 2024 11:04:54 +0000 (13:04 +0200)]
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>
(cherry picked from commit 7de464b00f1a188ec919abce56de6215f05fc4c0)

5 months agoMerge pull request #17345 from FRRouting/mergify/bp/dev/10.2/pr-17115
Donald Sharp [Tue, 5 Nov 2024 19:28:10 +0000 (14:28 -0500)]
Merge pull request #17345 from FRRouting/mergify/bp/dev/10.2/pr-17115

nhrpd: fix passphrase handling, add topotest for resolution request (backport #17115)

5 months agoMerge pull request #17357 from FRRouting/mergify/bp/dev/10.2/pr-17326
Donald Sharp [Tue, 5 Nov 2024 19:27:53 +0000 (14:27 -0500)]
Merge pull request #17357 from FRRouting/mergify/bp/dev/10.2/pr-17326

zebra: fix missing kernel routes (backport #17326)

5 months agoMerge pull request #17352 from FRRouting/mergify/bp/dev/10.2/pr-17319
Donald Sharp [Tue, 5 Nov 2024 19:26:20 +0000 (14:26 -0500)]
Merge pull request #17352 from FRRouting/mergify/bp/dev/10.2/pr-17319

ospfd: Use router_id what Zebra has if we remove a static router_id (backport #17319)

5 months agoMerge pull request #17347 from FRRouting/mergify/bp/dev/10.2/pr-17305
Jafar Al-Gharaibeh [Tue, 5 Nov 2024 18:14:02 +0000 (12:14 -0600)]
Merge pull request #17347 from FRRouting/mergify/bp/dev/10.2/pr-17305

bgpd: Treat numbered community-list only if it's in a range 1-500 (backport #17305)

5 months agotest: add test case for kernel blackhole routes 17357/head
anlan_cs [Fri, 1 Nov 2024 07:16:09 +0000 (15:16 +0800)]
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>
(cherry picked from commit 0073a870d1b769e96b4f23d0422914200591062e)

5 months agozebra: fix missing kernel routes
anlan_cs [Thu, 31 Oct 2024 14:44:05 +0000 (22:44 +0800)]
zebra: fix missing kernel routes

The `rib_update_handle_kernel_route_down_possibility()` didn't consider
the kernel routes ( blackhole )  without interface.  When some other
interfaces are down, these kernel routes will be wrongly removed.

Signed-off-by: anlan_cs <anlan_cs@126.com>
(cherry picked from commit 44a82da405879b1318f046dc67893934b57cbf37)

5 months agoospfd: Use router_id what Zebra has if we remove a static router_id 17352/head
Donatas Abraitis [Thu, 31 Oct 2024 09:38:40 +0000 (11:38 +0200)]
ospfd: Use router_id what Zebra has if we remove a static router_id

If we set router-id, e.g. `router-id x.x.x.x`, then we have:

```
pc.donatas.net# show ip ospf | include Router ID
 OSPF Routing Process, Router ID: x.x.x.x
```

But once we remove it (`no router-id x.x.x.x`), the old router-id remains.

This is kinda OK, but to be consistent with OSPFv3 we should use what Zebra
already has, instead of retaining the old one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 1073e0f9b39b2810a114dea03f2d1e0b14e414d4)

5 months agoospfd: Add a hidden command for old `no router-id`
Donatas Abraitis [Thu, 31 Oct 2024 09:37:49 +0000 (11:37 +0200)]
ospfd: Add a hidden command for old `no router-id`

A new command is `ospf router-id ...`, but the old one is also valid. Just a no
form was missed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 80bfe6784fa945640251ae5c907899eb9d77cc0a)

5 months agobgpd: Treat numbered community-list only if it's in a range 1-500 17347/head
Donatas Abraitis [Wed, 30 Oct 2024 08:45:28 +0000 (10:45 +0200)]
bgpd: Treat numbered community-list only if it's in a range 1-500

Before this patch, if we set something like:

```
bgp extcommunity-list expanded 1234 permit admin
```

In running config we have:

```
bgp extcommunity-list 1234 seq 5 permit admin
```

That leads to incorrect rendering, even more the line can't be deleted.

With this fix we treat numbered community-list only if it's inside the range
1-500, otherwise it's a non-numbered clist.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 4c1ee29116aff081f63b1fc7dad18cbfe1b8007f)

5 months agonhrpd: Modify NHRP authentication feature logging 17345/head
Joshua Muthii [Tue, 29 Oct 2024 16:08:14 +0000 (12:08 -0400)]
nhrpd: Modify NHRP authentication feature logging

Modified nhrp_connection_authorized(). Initially, when writing debug
information about incoming NHRP packets with authentication enabled,
the nhrp_connection_authorized() function would print the
passphrase of the incoming packet as if it were a null terminated
string. This meant that if the passphrase on the incoming packet
had non ASCII-complient bytes in it, it would attempt to print those
bytes anyway. There was also no check that the size of the passphrase in
the incoming packet matched the size of the passphrase on the interface.
The changes in this commit log the passphrase on the incoming packet as
well as the passphrase on interface in HEX to avoid issues with ASCII.
It also performs a check that accounts for the sizes of the two different
passphrases

Moved CISCO_PASS_LENGTH_LEN from nhrp_vty.c to nhrp_protocol.h
for easier access  to the macro in other files

Signed-off-by: Joshua Muthii <jmuthii@labn.net>
(cherry picked from commit 5718ee37c7717f61094a40168dae18c6d607ec44)

5 months agonhrpd: Add topotest for retrying resolution request
Joshua Muthii [Tue, 29 Oct 2024 16:05:59 +0000 (12:05 -0400)]
nhrpd: Add topotest for retrying resolution request

Modified nhrp_topo topotest to test for newly added resolution
request retry feature. Changes to the topotest include adding a spoke to the
existing nhrp_topo topotest so that a topology with two spokes and hub
can be used to create shortcuts and test the sending/resending of
resolution requests and responses between spoke and hub. The resolution
request retry feature was tested by blocking incoming resolution requests on a
receiving nodes to stop the creation of a successful shortcut - which
then triggered the sending spoke to retry sending resolution requests

Signed-off-by: Joshua Muthii <jmuthii@labn.net>
(cherry picked from commit d599aa1da6392c5d116df6bf2fa6bbc5b7b879c3)

5 months agoMerge pull request #17325 from FRRouting/mergify/bp/dev/10.2/pr-17317
Jafar Al-Gharaibeh [Fri, 1 Nov 2024 14:03:27 +0000 (09:03 -0500)]
Merge pull request #17325 from FRRouting/mergify/bp/dev/10.2/pr-17317

tests: Add an ability to specify daemon params with unified config (backport #17317)

5 months agoMerge pull request #17321 from FRRouting/mergify/bp/dev/10.2/pr-17318
Mark Stapp [Thu, 31 Oct 2024 16:00:42 +0000 (12:00 -0400)]
Merge pull request #17321 from FRRouting/mergify/bp/dev/10.2/pr-17318

zebra: Add missing new line for help string (backport #17318)

5 months agotests: Add an ability to specify daemon params with unified config 17325/head
Donatas Abraitis [Thu, 31 Oct 2024 08:43:28 +0000 (10:43 +0200)]
tests: Add an ability to specify daemon params with unified config

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 879466731bf36eaf696a29c8d96914443660dd74)

5 months agoMerge pull request #17300 from FRRouting/mergify/bp/dev/10.2/pr-17250
Donatas Abraitis [Thu, 31 Oct 2024 13:17:02 +0000 (15:17 +0200)]
Merge pull request #17300 from FRRouting/mergify/bp/dev/10.2/pr-17250

isisd: fix change flex-algorithm number from uint32 to uint8 (backport #17250)

5 months agozebra: Add missing new line for help string 17321/head
Donatas Abraitis [Thu, 31 Oct 2024 08:47:48 +0000 (10:47 +0200)]
zebra: Add missing new line for help string

```
  -A, --asic-offload        FRR is interacting with an asic underneath the linux kernel
      --v6-with-v4-nexthops Underlying dataplane supports v6 routes with v4 nexthops  -s, --nl-bufsize          Set netlink receive buffer size
```

Fixes: 1f5611c06d1c243b42279748788f0627793ead9c ("zebra: Allow zebra cli to accept v6 routes with v4 nexthops")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 25ae643996d338b8230fb15a9064843fe85de224)

5 months agoMerge pull request #17315 from FRRouting/mergify/bp/dev/10.2/pr-17310
Jafar Al-Gharaibeh [Wed, 30 Oct 2024 21:16:25 +0000 (16:16 -0500)]
Merge pull request #17315 from FRRouting/mergify/bp/dev/10.2/pr-17310

doc: Create html_context before setting READTHEDOCS (backport #17310)

5 months agoMerge pull request #17309 from donaldsharp/backport_17254_10.2
Jafar Al-Gharaibeh [Wed, 30 Oct 2024 19:36:56 +0000 (14:36 -0500)]
Merge pull request #17309 from donaldsharp/backport_17254_10.2

Mrib nht wonky (backport #17254)

5 months agodoc: Create html_context before setting READTHEDOCS 17315/head
Donatas Abraitis [Wed, 30 Oct 2024 12:15:36 +0000 (14:15 +0200)]
doc: Create html_context before setting READTHEDOCS

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/frrouting/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 529, in eval_config_file
    exec(code, namespace)  # NoQA: S102
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/frrouting/checkouts/latest/doc/user/conf.py", line 77, in <module>
    html_context["READTHEDOCS"] = True
    ^^^^^^^^^^^^
NameError: name 'html_context' is not defined

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit ef9f698e04211281c803a67f3480835f62aae3ee)

5 months agozebra: When installing a mroute, allow it to flow 17309/head
Donald Sharp [Sat, 26 Oct 2024 01:56:14 +0000 (21:56 -0400)]
zebra: When installing a mroute, allow it to flow

Currently the mroute code was not allowing the mroute
to be sent to the dataplane.  This leaves us with a
situation where the routes being installed where never
being set as installed and additionally nht against
the mrib would not work if the route came into existence
after the nexthop tracking was asked for.

Turns out all the pieces where there to let this work.
Modify the code to pass it to the dplane and to send
it back up as having worked.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agozebra: Add safi to some debugs
Donald Sharp [Fri, 25 Oct 2024 19:44:34 +0000 (15:44 -0400)]
zebra: Add safi to some debugs

Trying to figure out what safi we are talking about is fun when
it is not put into the debugs.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 811168ecc3850a159fc22beaf30e42be63111413)

5 months agosharpd: Allow sharpd to watch nexthops in the mrib
Donald Sharp [Sat, 26 Oct 2024 01:21:32 +0000 (21:21 -0400)]
sharpd: Allow sharpd to watch nexthops in the mrib

Nothing special here, just allow sharpd to ask to watch
nexthops in the mrib.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit aff8eaa4a2dec64a66ea7349dfffac1b0dac2820)

5 months agoisisd: fix change flex-algorithm number from uint32 to uint8 17300/head
Philippe Guibert [Fri, 25 Oct 2024 08:23:54 +0000 (10:23 +0200)]
isisd: fix change flex-algorithm number from uint32 to uint8

The algorithm number is encoded on 8 bits and does not require
an unsigned 32 bit value to store the value.

Fixes: cc4926c1284e ("isisd,yang: add algorithm-prefix-sid configuration tree")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 8e861a75e8b426f0944157387699fe1ab322fe8e)

5 months agoMerge pull request #17291 from FRRouting/mergify/bp/dev/10.2/pr-17245
Russ White [Tue, 29 Oct 2024 14:22:54 +0000 (10:22 -0400)]
Merge pull request #17291 from FRRouting/mergify/bp/dev/10.2/pr-17245

bgpd:  fix crash when polling bgp4v2PathAttrTable (backport #17245)

5 months agobgpd: fix crash when polling bgp4v2PathAttrTable 17291/head
Francois Dumontet [Mon, 21 Oct 2024 10:49:50 +0000 (12:49 +0200)]
bgpd:  fix crash when polling bgp4v2PathAttrTable

we have

(gdb) p *path->attr->aspath
$1 = {refcnt = 3, segments = 0x0, json = 0x0, str = 0x55723d0b7470 "", str_len = 0, asnotation = ASNOTATION_PLAIN}

It looks like this aspath is empty, resulting in a size 0 and NULL pointer for path->attr->aspath->segments which leads to the SIGSEGV

fixe: return 0 when segments is null.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
(cherry picked from commit ee2f1b85cf95fcbfd0a54dc15b911f525e96b163)

5 months agoMerge pull request #17282 from FRRouting/mergify/bp/dev/10.2/pr-17278
Donatas Abraitis [Tue, 29 Oct 2024 11:17:07 +0000 (13:17 +0200)]
Merge pull request #17282 from FRRouting/mergify/bp/dev/10.2/pr-17278

bgpd: fix blank line in running-config with bmp listener cmd (backport #17278)

5 months agobgpd: fix blank line in running-config with bmp listener cmd 17282/head
Philippe Guibert [Mon, 28 Oct 2024 15:04:45 +0000 (16:04 +0100)]
bgpd: fix blank line in running-config with bmp listener cmd

An extra blank line is added in show running-config with BMP:

> ubuntu2204hwe(config)# router bgp 65500
> ubuntu2204hwe(config-router)# bmp targets tgt
> ubuntu2204hwe(config-bgp-bmp)# bmp monitor ipv4 unicast pre-policy
> ubuntu2204hwe(config-bgp-bmp)# bmp listener 192.0.2.100 port 44
> ubuntu2204hwe(config-bgp-bmp)# do show running-config
>
> router bgp 65500
> [..]
>  bmp targets tgt
>   bmp monitor ipv4 unicast pre-policy
>                                       <-- blank line
>   bmp listener 192.0.2.100 port 44
>  exit

Remove the blank line.

Fixes: ed18356f1f2d ("bgpd/bmp: BMP implementation")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 9a33ee18bfe2769e173911d69cee64b78143184b)

6 months agoMerge pull request #17277 from FRRouting/mergify/bp/dev/10.2/pr-17157
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 18:21:17 +0000 (13:21 -0500)]
Merge pull request #17277 from FRRouting/mergify/bp/dev/10.2/pr-17157

tests: logger masked in topotest.py (backport #17157)

6 months agoMerge pull request #17265 from FRRouting/mergify/bp/dev/10.2/pr-16354
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 17:53:35 +0000 (12:53 -0500)]
Merge pull request #17265 from FRRouting/mergify/bp/dev/10.2/pr-16354

bgpd: add bgp ipv6-auto-ra command (backport #16354)

6 months agoMerge pull request #17272 from FRRouting/mergify/bp/dev/10.2/pr-17243
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 17:37:30 +0000 (12:37 -0500)]
Merge pull request #17272 from FRRouting/mergify/bp/dev/10.2/pr-17243

bgpd: fix display of local label in show bgp (backport #17243)

6 months agotests: logger masked in topotest.py 17277/head
Liam Brady [Thu, 17 Oct 2024 17:35:36 +0000 (13:35 -0400)]
tests: logger masked in topotest.py

a local logger masks the global logger and prevents errors from being
gracefully handled within topotest.py

Signed-off-by: Liam Brady <lbrady@labn.net>
(cherry picked from commit 1b38f3304170d7a57715aab0607317eba0698d39)

6 months agobgpd: fix display of local label in show bgp 17272/head
Louis Scalbert [Fri, 25 Oct 2024 15:54:07 +0000 (17:54 +0200)]
bgpd: fix display of local label in show bgp

Fix the display of the local label in show bgp.

> r1# show bgp ipv4 labeled-unicast 172.16.2.2/32
> BGP routing table entry for 172.16.2.2/32, version 2
> Local label: 16 <---- MISSING
> Paths: (1 available, best #1, table default, vrf (null))
>   Advertised to non peer-group peers:
>  192.168.1.2
>  65501
>    192.168.1.2 from 192.168.1.2 (172.16.2.2)
>      Origin IGP, metric 0, valid, external, best (First path received)
>      Remote label: 3
>      Last update: Fri Oct 25 17:55:45 2024

Fixes: 67f67ba481 ("bgpd: Drop label_ntop/label_pton functions")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit e7b3276ace65d59edb4d614158d4f2959f12f868)

6 months agoMerge pull request #17258 from FRRouting/mergify/bp/dev/10.2/pr-17160
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 13:56:04 +0000 (08:56 -0500)]
Merge pull request #17258 from FRRouting/mergify/bp/dev/10.2/pr-17160

lib, zebra: Keep `zebra on-rib-process script` in frr.conf (backport #17160)

6 months agobgpd: add `bgp ipv6-auto-ra` command 17265/head
Mikhail Sokolovskiy [Tue, 24 Sep 2024 16:00:11 +0000 (19:00 +0300)]
bgpd: add `bgp ipv6-auto-ra` command

Introduce a command to stop bgpd from enabling IPv6 router advertisement
messages sending on interfaces.

Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
(cherry picked from commit 7b1c0c23fcdebda088d4dae334bbbadaf16cea55)

6 months agoMerge pull request #17256 from FRRouting/mergify/bp/dev/10.2/pr-17216
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 04:41:15 +0000 (23:41 -0500)]
Merge pull request #17256 from FRRouting/mergify/bp/dev/10.2/pr-17216

pimd, tests: fix bsr assert and expand topotest to pimv6 (backport #17216)

6 months agolib, zebra: Keep `zebra on-rib-process script` in frr.conf 17258/head
Donatas Abraitis [Fri, 18 Oct 2024 12:36:52 +0000 (15:36 +0300)]
lib, zebra: Keep `zebra on-rib-process script` in frr.conf

After the change:

```
$ grep on-rib-process /etc/frr/frr.conf
zebra on-rib-process script script4

$ systemctl restart frr

$ vtysh -c 'show run' | grep on-rib-process
zebra on-rib-process script script4
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 1fe1f8d87c4ab46ae18536a2418c05ae5fd95185)

6 months agotests: expand bsr topotest to cover ipv6 17256/head
Jafar Al-Gharaibeh [Wed, 23 Oct 2024 05:09:06 +0000 (00:09 -0500)]
tests: expand bsr topotest to cover ipv6

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
(cherry picked from commit a7e7cc301d4784c738ef40e0a2231e3078419aae)

6 months agopimd: allow a bsr with higher priority to take over
Jafar Al-Gharaibeh [Wed, 23 Oct 2024 19:14:58 +0000 (14:14 -0500)]
pimd: allow a bsr with higher priority to take over

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
(cherry picked from commit 4e74183d0f35fcb28f4dd8b88920b0426a426e3f)

6 months agopimd: allow resolving bsr via directly connected secondary address
Jafar Al-Gharaibeh [Wed, 23 Oct 2024 04:09:53 +0000 (23:09 -0500)]
pimd: allow resolving bsr via directly connected secondary address

This only matters to single hop nodes that are adjacent to the bsr. More common
with IPv6 where LL address is used in PIM as the primary address. If the BSR IP
happens to be an address on the same interface, the receiving pim router
rejects the BSR address because it expects the BSR IP to resolve via the LL address
even if we have a connected route for the same BSR IP subnet. Effectively, we want to
allow rpf to be resolved via secondary IPs with connected routes on the same interface,
and not limit them to primary addresses.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
(cherry picked from commit 8fbd88c5a73ec9a6d88b8fd310a943a6765caf8a)

6 months agoMerge pull request #17232 from FRRouting/mergify/bp/dev/10.2/pr-17215
Donald Sharp [Fri, 25 Oct 2024 11:34:00 +0000 (07:34 -0400)]
Merge pull request #17232 from FRRouting/mergify/bp/dev/10.2/pr-17215

pimd: PIM autorp no path RP fix (backport #17215)

6 months agoMerge pull request #17234 from FRRouting/mergify/bp/dev/10.2/pr-17199
Donatas Abraitis [Fri, 25 Oct 2024 10:10:24 +0000 (13:10 +0300)]
Merge pull request #17234 from FRRouting/mergify/bp/dev/10.2/pr-17199

bgpd: compare aigp after local route check in bgp_path_info_cmp() (backport #17199)

6 months agobgpd: compare aigp after local route check in bgp_path_info_cmp() 17234/head
Enke Chen [Thu, 24 Oct 2024 17:50:37 +0000 (10:50 -0700)]
bgpd: compare aigp after local route check in bgp_path_info_cmp()

For consistency between RIB and BGP, the aigp comparison should
be made after the local route check in bgp bestpath selection.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 6a7049aaacc32e6a473a4d56ca61444d1e1eb45d)

6 months agotests: add a new BGP AIGP topotest
Enke Chen [Thu, 24 Oct 2024 17:30:24 +0000 (10:30 -0700)]
tests: add a new BGP AIGP topotest

The topotest verifies that a local route is favored irrespective
of its AIGP value.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 1a2c3d684a6a8054eb8cf878955834cbbec6efe1)

6 months agopimd: PIM autorp no path RP fix 17232/head
Nathan Bahr [Tue, 22 Oct 2024 15:32:52 +0000 (15:32 +0000)]
pimd: PIM autorp no path RP fix

Just because there is currently no path to the RP doesn't mean it failed to add.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
(cherry picked from commit 433fce647c550a309a0869fbd499b0f3a12da551)

6 months agoMerge pull request #17221 from FRRouting/mergify/bp/dev/10.2/pr-17191
Jafar Al-Gharaibeh [Thu, 24 Oct 2024 21:10:18 +0000 (16:10 -0500)]
Merge pull request #17221 from FRRouting/mergify/bp/dev/10.2/pr-17191

bgpd: fix uninitialized bgp_labels (backport #17191)

6 months agobgpd: fix uninitialized labels 17221/head
Louis Scalbert [Tue, 22 Oct 2024 16:08:13 +0000 (18:08 +0200)]
bgpd: fix uninitialized labels

Fix uninitialized labels that cause multiple valgrind issues.

> ==3729602== Use of uninitialised value of size 8
> ==3729602==    at 0x492B493: hash_get (hash.c:140)
> ==3729602==    by 0x2629D2: bgp_labels_intern (bgp_label.c:98)
> ==3729602==    by 0x2E6C92: bgp_adj_out_set_subgroup (bgp_updgrp_adv.c:622)
> ==3729602==    by 0x2A6810: subgroup_process_announce_selected (bgp_route.c:3340)
> ==3729602==    by 0x2E5FF6: group_announce_route_walkcb (bgp_updgrp_adv.c:260)
> ==3729602==    by 0x2E3E28: update_group_walkcb (bgp_updgrp.c:1759)
> ==3729602==    by 0x492B9A0: hash_walk (hash.c:270)
> ==3729602==    by 0x2E498C: update_group_af_walk (bgp_updgrp.c:2090)
> ==3729602==    by 0x2E7C0D: group_announce_route (bgp_updgrp_adv.c:1119)
> ==3729602==    by 0x2A796E: bgp_process_main_one (bgp_route.c:3865)
> ==3729602==    by 0x2A808A: bgp_process_wq (bgp_route.c:3991)
> ==3729602==    by 0x49CC7CF: work_queue_run (workqueue.c:282)
> ==3729602==    by 0x49BBF25: event_call (event.c:2019)
> ==3729602==    by 0x49413CA: frr_run (libfrr.c:1238)
> ==3729602==    by 0x1FD1D3: main (bgp_main.c:555)

> ==2604268== Use of uninitialised value of size 8
> ==2604268==    at 0x4943016: hash_get (hash.c:159)
> ==2604268==    by 0x26EFC1: bgp_labels_intern (bgp_label.c:97)
> ==2604268==    by 0x28077B: leak_update (bgp_mplsvpn.c:1298)
> ==2604268==    by 0x2824A3: vpn_leak_from_vrf_update (bgp_mplsvpn.c:1932)
> ==2604268==    by 0x2C281C: bgp_static_update (bgp_route.c:6974)
> ==2604268==    by 0x2C366F: bgp_static_set (bgp_route.c:7263)
> ==2604268==    by 0x2C435B: bgp_network_magic (bgp_route.c:7556)
> ==2604268==    by 0x2ACF09: bgp_network (bgp_route_clippy.c:86)
> ==2604268==    by 0x4914EE7: cmd_execute_command_real (command.c:1003)
> ==2604268==    by 0x4915060: cmd_execute_command (command.c:1062)
> ==2604268==    by 0x4915610: cmd_execute (command.c:1228)
> ==2604268==    by 0x49E7C32: vty_command (vty.c:625)
> ==2604268==    by 0x49E9B56: vty_execute (vty.c:1388)
> ==2604268==    by 0x49EC331: vtysh_read (vty.c:2400)
> ==2604268==    by 0x49E06F1: event_call (event.c:2001)
> ==2604268==    by 0x495AB8B: frr_run (libfrr.c:1238)
> ==2604268==    by 0x200C4B: main (bgp_main.c:555)

Fixes: ddb5b4880b ("bgpd: vpn-vrf route leaking")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 3225b778cafa46be8233f3512737d85872db67dd)

6 months agobgpd: fix allocating uninitialized bgp_labels
Louis Scalbert [Tue, 22 Oct 2024 13:07:26 +0000 (15:07 +0200)]
bgpd: fix allocating uninitialized bgp_labels

Memory was not zeroed at allocation.

> ==2604268== Conditional jump or move depends on uninitialised value(s)
> ==2604268==    at 0x26F026: bgp_labels_unintern (bgp_label.c:116)
> ==2604268==    by 0x30000C: adj_free (bgp_updgrp_adv.c:81)
> ==2604268==    by 0x3019EE: bgp_adj_out_remove_subgroup (bgp_updgrp_adv.c:728)
> ==2604268==    by 0x30537C: subgroup_withdraw_packet (bgp_updgrp_packet.c:1042)
> ==2604268==    by 0x2970AF: bgp_generate_updgrp_packets (bgp_packet.c:508)
> ==2604268==    by 0x49E06F1: event_call (event.c:2001)
> ==2604268==    by 0x495AB8B: frr_run (libfrr.c:1238)
> ==2604268==    by 0x200C4B: main (bgp_main.c:555)

Fixes: 3c86f776f0 ("bgpd: add bgp_labels hash")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit dd10379b3e4c544874306fbb5efec5afc1cf1f9e)

6 months agoMerge pull request #17201 from FRRouting/mergify/bp/dev/10.2/pr-17198
Donatas Abraitis [Wed, 23 Oct 2024 06:18:44 +0000 (09:18 +0300)]
Merge pull request #17201 from FRRouting/mergify/bp/dev/10.2/pr-17198

Revert "lib: Attach stdout to child only if --log=stdout and stdout F… (backport #17198)

6 months agoRevert "lib: Attach stdout to child only if --log=stdout and stdout FD is a tty" 17201/head
Donald Sharp [Tue, 22 Oct 2024 15:13:07 +0000 (11:13 -0400)]
Revert "lib: Attach stdout to child only if --log=stdout and stdout FD is a tty"

This reverts commit 0e3c5e8e5907321b35201f0985c1d3f4a1b0e639.

(cherry picked from commit 6a36b9ef49bfce59a7e674df233265da6d275257)

6 months agoMerge pull request #17195 from FRRouting/mergify/bp/dev/10.2/pr-17165
Russ White [Tue, 22 Oct 2024 19:25:45 +0000 (15:25 -0400)]
Merge pull request #17195 from FRRouting/mergify/bp/dev/10.2/pr-17165

bgpd: Do not filter no-export community for BGP OAD (backport #17165)

6 months agotests: Check if BGP no-export community is passed to BGP OAD peers 17195/head
Donatas Abraitis [Fri, 18 Oct 2024 19:51:37 +0000 (22:51 +0300)]
tests: Check if BGP no-export community is passed to BGP OAD peers

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 7eaec540ec8aaca5821fc5ac1259b8eb8127f230)

6 months agobgpd: Do not filter no-export community for BGP OAD (one administration domain)
Donatas Abraitis [Fri, 18 Oct 2024 19:35:28 +0000 (22:35 +0300)]
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>
(cherry picked from commit e63b1520f1ad1036455c1626a388ac3afb7f9d6d)

6 months agoMerge pull request #17184 from FRRouting/mergify/bp/dev/10.2/pr-17168
Jafar Al-Gharaibeh [Tue, 22 Oct 2024 14:39:50 +0000 (09:39 -0500)]
Merge pull request #17184 from FRRouting/mergify/bp/dev/10.2/pr-17168

bgpd: fix AIGP calculation in route advertisement (backport #17168)

6 months agobgpd: fix AIGP calculation in route advertisement 17184/head
Enke Chen [Tue, 22 Oct 2024 01:03:08 +0000 (18:03 -0700)]
bgpd: fix AIGP calculation in route advertisement

Currently the AIGP is always incremented when a route with the
attribute is advertised. That is incorrect when the nexthop is
unchanged, as is commonly the case in route reflection.

Adjust the AIGP for propagation only when the nexthop is set
to ourselves.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit fc82d7750f3cc54855ca399f3060428b66e1fbec)

6 months agotests: add a topotest bgp_aigp_rr
Enke Chen [Tue, 22 Oct 2024 00:49:19 +0000 (17:49 -0700)]
tests: add a topotest bgp_aigp_rr

In this topotest, the route reflector advertises a route with the
aigp attribute to its client, some with the nexthop unchanged and
some with the nexthp changed. Different aigp values are sent to
the clients depending on the nexthop setting.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 7e7f65cc00b13108e260bef329fc17374ea384f6)

6 months agoMerge pull request #17175 from FRRouting/mergify/bp/dev/10.2/pr-17169
Donatas Abraitis [Tue, 22 Oct 2024 05:40:06 +0000 (08:40 +0300)]
Merge pull request #17175 from FRRouting/mergify/bp/dev/10.2/pr-17169

bgpd: allow value 0 in aigp-metric setting (backport #17169)

6 months agobgpd: allow value 0 in aigp-metric setting 17175/head
Enke Chen [Sun, 20 Oct 2024 19:25:46 +0000 (12:25 -0700)]
bgpd: allow value 0 in aigp-metric setting

The value of 0 is accepted from peers, and can also be set by the
route-map "set aigp-metric igp-metric". For coonsistency, it should
be allowed in "set aigp-metric <value>" as well.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit e07f38a43f0b176fcfb96403db71291c04f76cfb)

6 months agoMerge pull request #17146 from FRRouting/mergify/bp/dev/10.2/pr-17091
Donatas Abraitis [Thu, 17 Oct 2024 11:26:04 +0000 (14:26 +0300)]
Merge pull request #17146 from FRRouting/mergify/bp/dev/10.2/pr-17091

bgpd: fix several issues in sourcing AIGP attribute (backport #17091)

6 months agotests: add a new topotest to bgp_aigp 17146/head
Enke Chen [Wed, 16 Oct 2024 18:19:28 +0000 (11:19 -0700)]
tests: add a new topotest to bgp_aigp

Add a new topotest for getting the aigp from the "igp-metric"
for a redistributed route (ospf route in the test).

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 51612593f7f747d0003a48a41367be87d3ea5361)

6 months agobgpd: fix several issues in sourcing AIGP attribute
Enke Chen [Wed, 16 Oct 2024 18:15:28 +0000 (11:15 -0700)]
bgpd: fix several issues in sourcing AIGP attribute

Fix several issues in sourcing AIGP attribute:

1) AIGP should not be set as default for a redistributed route or a
   static network. It should be set by config instead.

2) AIGP sourced by "set aigp-metric igp-metric" in a route-map does
   not set the correct value for a redistributed route.

3) When redistribute a connected route like loopback, the AGIP (with
   value 0) is sourced by "set aigp-metric igp-metric", but the
   attribute is not propagated as the attribute flag is not set.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit f65356d8bb9a43b1725fafdbd30aba0de9d214fa)

6 months agoMerge pull request #17143 from FRRouting/mergify/bp/dev/10.2/pr-17020
Donald Sharp [Wed, 16 Oct 2024 19:23:38 +0000 (15:23 -0400)]
Merge pull request #17143 from FRRouting/mergify/bp/dev/10.2/pr-17020

zebra: fix heap-use-after free on ns shutdown (backport #17020)

6 months agoMerge pull request #17129 from FRRouting/mergify/bp/dev/10.2/pr-17116
Donald Sharp [Wed, 16 Oct 2024 16:49:30 +0000 (12:49 -0400)]
Merge pull request #17129 from FRRouting/mergify/bp/dev/10.2/pr-17116

zebra: unlock node only after operation in zebra_free_rnh() (backport #17116)

6 months agozebra: fix heap-use-after free on ns shutdown 17143/head
Philippe Guibert [Mon, 7 Oct 2024 13:11:43 +0000 (15:11 +0200)]
zebra: fix heap-use-after free on ns shutdown

The following ASAN issue has been observed:

> ERROR: AddressSanitizer: heap-use-after-free on address 0x6160000acba4 at pc 0x55910c5694d0 bp 0x7ffe3a8ac850 sp 0x7ffe3a8ac840
> READ of size 4 at 0x6160000acba4 thread T0
>         #0 0x55910c5694cf in ctx_info_from_zns zebra/zebra_dplane.c:3315
>     #1 0x55910c569696 in dplane_ctx_ns_init zebra/zebra_dplane.c:3331
>     #2 0x55910c56bf61 in dplane_ctx_nexthop_init zebra/zebra_dplane.c:3680
>     #3 0x55910c5711ca in dplane_nexthop_update_internal zebra/zebra_dplane.c:4490
>     #4 0x55910c571c5c in dplane_nexthop_delete zebra/zebra_dplane.c:4717
>     #5 0x55910c61e90e in zebra_nhg_uninstall_kernel zebra/zebra_nhg.c:3413
>     #6 0x55910c615d8a in zebra_nhg_decrement_ref zebra/zebra_nhg.c:1919
>     #7 0x55910c6404db in route_entry_update_nhe zebra/zebra_rib.c:454
>     #8 0x55910c64c904 in rib_re_nhg_free zebra/zebra_rib.c:2822
>     #9 0x55910c655be2 in rib_unlink zebra/zebra_rib.c:4212
>     #10 0x55910c6430f9 in zebra_rtable_node_cleanup zebra/zebra_rib.c:968
>     #11 0x7f26f275b8a9 in route_node_free lib/table.c:75
>     #12 0x7f26f275bae4 in route_table_free lib/table.c:111
>     #13 0x7f26f275b749 in route_table_finish lib/table.c:46
>     #14 0x55910c65db17 in zebra_router_free_table zebra/zebra_router.c:191
>     #15 0x55910c65dfb5 in zebra_router_terminate zebra/zebra_router.c:244
>     #16 0x55910c4f40db in zebra_finalize zebra/main.c:249
>     #17 0x7f26f2777108 in event_call lib/event.c:2011
>     #18 0x7f26f264180e in frr_run lib/libfrr.c:1212
>     #19 0x55910c4f49cb in main zebra/main.c:531
>     #20 0x7f26f2029d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
>     #21 0x7f26f2029e3f in __libc_start_main_impl ../csu/libc-start.c:392
>     #22 0x55910c4b0114 in _start (/usr/lib/frr/zebra+0x1ae114)

It happens with FRR using the kernel. During shutdown, the
namespace identifier is attempted to be obtained by zebra, in an
attempt to prepare zebra dataplane nexthop messages.

Fix this by accessing the ns structure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 7ae70eb5ef48e565427b416e22a1ccbed1e96120)

6 months agoMerge pull request #17127 from FRRouting/mergify/bp/dev/10.2/pr-17107
Donald Sharp [Wed, 16 Oct 2024 09:50:32 +0000 (05:50 -0400)]
Merge pull request #17127 from FRRouting/mergify/bp/dev/10.2/pr-17107

tests: iproute2_check_path_selection call the actual command (backport #17107)

6 months agozebra: unlock node only after operation in zebra_free_rnh() 17129/head
Enke Chen [Tue, 15 Oct 2024 17:23:10 +0000 (10:23 -0700)]
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>
(cherry picked from commit 5b6ff51b8ae7f8c7348cea4de9543956f32641a7)

6 months agotests: iproute2_check_path_selection call the actual command 17127/head
Donald Sharp [Tue, 15 Oct 2024 13:51:08 +0000 (09:51 -0400)]
tests: iproute2_check_path_selection call the actual command

For some reason this was missing.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit c8a947e12bbbcc16d6057975bf7c65661db2fc86)

6 months agoMerge pull request #17120 from FRRouting/mergify/bp/dev/10.2/pr-17088
Donald Sharp [Tue, 15 Oct 2024 21:55:22 +0000 (17:55 -0400)]
Merge pull request #17120 from FRRouting/mergify/bp/dev/10.2/pr-17088

zebra: Prevent a kernel route from being there when a connected should (backport #17088)

6 months agozebra: Prevent a kernel route from being there when a connected should 17120/head
Donald Sharp [Mon, 14 Oct 2024 15:25:32 +0000 (11:25 -0400)]
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>
(cherry picked from commit 74e25198e74c4066b630515d2971c3c9381d70f2)

6 months agoMerge pull request #17108 from FRRouting/mergify/bp/dev/10.2/pr-17093
Donald Sharp [Tue, 15 Oct 2024 17:11:55 +0000 (13:11 -0400)]
Merge pull request #17108 from FRRouting/mergify/bp/dev/10.2/pr-17093

bgpd: fix route selection with AIGP (backport #17093)

6 months agotests: fix and adjust topotest/bgp_aigp 17108/head
Enke Chen [Tue, 15 Oct 2024 01:47:59 +0000 (18:47 -0700)]
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>
(cherry picked from commit 1ee7e63a6c432662ef3a9a2bd0e1c41298bdf196)

6 months agobgpd: fix route selection with AIGP
Enke Chen [Tue, 15 Oct 2024 01:42:15 +0000 (18:42 -0700)]
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>
(cherry picked from commit 081422e8e71085d3a3d4d2ff0bc1e1abaff0d52e)

6 months agoMerge pull request #17094 from FRRouting/mergify/bp/dev/10.2/pr-17074
Donatas Abraitis [Tue, 15 Oct 2024 07:50:30 +0000 (10:50 +0300)]
Merge pull request #17094 from FRRouting/mergify/bp/dev/10.2/pr-17074

bgpd: fix evpn mh esi down (backport #17074)

6 months agobgpd: fix evpn mh esi flap remove local routes 17094/head
Chirag Shah [Tue, 8 Oct 2024 02:04:43 +0000 (19:04 -0700)]
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>
(cherry picked from commit 3f00709a39ab2fe6f4bbae3d8f4b17baaab2e3dd)

6 months agoMerge pull request #17066 from FRRouting/mergify/bp/dev/10.2/pr-17059
Donald Sharp [Fri, 11 Oct 2024 16:14:53 +0000 (12:14 -0400)]
Merge pull request #17066 from FRRouting/mergify/bp/dev/10.2/pr-17059

bgpd: Move some non BGP-specific route-map functions to lib (backport #17059)

6 months agoMerge pull request #17063 from FRRouting/mergify/bp/dev/10.2/pr-17037
Donatas Abraitis [Fri, 11 Oct 2024 13:24:46 +0000 (16:24 +0300)]
Merge pull request #17063 from FRRouting/mergify/bp/dev/10.2/pr-17037

bgpd: fix ipv6 nexthop-local unchanged (backport #17037)

6 months agobgpd: Move some non BGP-specific route-map functions to lib 17066/head
Donatas Abraitis [Thu, 10 Oct 2024 13:50:38 +0000 (16:50 +0300)]
bgpd: Move some non BGP-specific route-map functions to lib

They are managed under `frr-route-map`, not under `frr-bgp-route-map`.

Fixes: https://github.com/FRRouting/frr/issues/17055
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit b9a9be492e8dde39a0040bd1140893ccab83c2be)