]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
4 months agobgpd: fix unconfigure asdot neighbor
Philippe Guibert [Wed, 4 Dec 2024 20:25:33 +0000 (21:25 +0100)]
bgpd: fix unconfigure asdot neighbor

The below command is not successfull on an existing as dot peer

> no neighbor 10.0.0.2 remote-as 1.1
> % Create the peer-group or interface first

Handle the case where the remote-as argument can be an ASNUM.

Fixes: 8079a4138d61 ("lib, bgp: add initial support for asdot format")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agoMerge pull request #17564 from FRRouting/mergify/bp/stable/10.0/pr-17518
Jafar Al-Gharaibeh [Wed, 4 Dec 2024 05:42:25 +0000 (23:42 -0600)]
Merge pull request #17564 from FRRouting/mergify/bp/stable/10.0/pr-17518

pimd: Fix access-list memory leak in pimd (backport #17518)

4 months agoMerge pull request #17560 from FRRouting/mergify/bp/stable/10.0/pr-17313
Jafar Al-Gharaibeh [Wed, 4 Dec 2024 03:49:46 +0000 (21:49 -0600)]
Merge pull request #17560 from FRRouting/mergify/bp/stable/10.0/pr-17313

zebra: separate zebra ZAPI server open and accept (backport #17313)

4 months agopimd: Fix access-list memory leak in pimd
Corey Siltala [Tue, 26 Nov 2024 16:04:14 +0000 (10:04 -0600)]
pimd: Fix access-list memory leak in pimd

Reset access-lists in pimd on terminate

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
(cherry picked from commit d21a993f16dc23df6a1f1a7c81e9f562446437a0)

4 months agozebra: separate zebra ZAPI server open and accept
Mark Stapp [Wed, 30 Oct 2024 15:02:17 +0000 (11:02 -0400)]
zebra: separate zebra ZAPI server open and accept

Separate zebra's ZAPI server socket handling into two phases:
an early phase that opens the socket, and a later phase that
starts listening for client connections.

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

5 months agoMerge pull request #17524 from FRRouting/mergify/bp/stable/10.0/pr-17510
Donatas Abraitis [Thu, 28 Nov 2024 05:53:56 +0000 (07:53 +0200)]
Merge pull request #17524 from FRRouting/mergify/bp/stable/10.0/pr-17510

bgpd: fix use single whitespace when displaying flowspec entries (backport #17510)

5 months agobgpd: fix use single whitespace when displaying flowspec entries
Philippe Guibert [Tue, 26 Nov 2024 13:19:34 +0000 (14:19 +0100)]
bgpd: fix use single whitespace when displaying flowspec entries

There is an extra space in the 'Displayed' line of show bgp command,
that should not be present.
Fix this by being consistent with the output of the other address
families.

Fixes: ("a1baf9e84f71") bgpd: Use single whitespace when displaying show bgp summary
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 561debab5430ac85e8e42e839312d213479a767a)

5 months agoMerge pull request #17513 from FRRouting/mergify/bp/stable/10.0/pr-17506
Russ White [Tue, 26 Nov 2024 16:49:27 +0000 (11:49 -0500)]
Merge pull request #17513 from FRRouting/mergify/bp/stable/10.0/pr-17506

bgpd: fix version attribute is an int, not a string (backport #17506)

5 months agobgpd: fix version attribute is an int, not a string
Philippe Guibert [Mon, 25 Nov 2024 21:47:21 +0000 (22:47 +0100)]
bgpd: fix version attribute is an int, not a string

The json display of the version attribute is originally an
integer. It has changed, most probably mistakenly.

> {
>   "vrfId": 7,
>   "vrfName": "vrf1",
>   "tableVersion": 3,
>   "routerId": "192.0.2.1",
>   "defaultLocPrf": 100,
>   "localAS": 65500,
>   "routes": {
>     "172.31.0.1/32": {
>       "prefix": "172.31.0.1/32",
>       "version": "1", <--- int or string ??

Let us fix it, by using the integer display instead.

Fixes: f9f2d188e398 ("bgpd: fix 'json detail' output structure")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit c5d7815cccb92c192ca6b752843b8b827a607b53)

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

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

5 months agobgpd: Do not reset peers on suppress-fib toggling
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 #17448 from opensourcerouting/fix/backport_65a43b57efd60c4fdf80c93...
Donald Sharp [Tue, 19 Nov 2024 14:29:24 +0000 (09:29 -0500)]
Merge pull request #17448 from opensourcerouting/fix/backport_65a43b57efd60c4fdf80c935750046ba861ec79f_10.0

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

5 months agobgpd: Validate both nexthop information (NEXTHOP and NLRI)
Donatas Abraitis [Sun, 17 Nov 2024 09:25:41 +0000 (11:25 +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 agoMerge pull request #17417 from FRRouting/mergify/bp/stable/10.0/pr-17402
Jafar Al-Gharaibeh [Tue, 12 Nov 2024 17:45:12 +0000 (11:45 -0600)]
Merge pull request #17417 from FRRouting/mergify/bp/stable/10.0/pr-17402

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

5 months agobgpd: Fix for match source-protocol in route-map for redistribute cmd
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)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit f93e5aa1663d9b375e0673f4eed367f9a009fa88)

5 months agoMerge pull request #17405 from FRRouting/mergify/bp/stable/10.0/pr-15686
Russ White [Tue, 12 Nov 2024 15:02:11 +0000 (10:02 -0500)]
Merge pull request #17405 from FRRouting/mergify/bp/stable/10.0/pr-15686

BGP TCP non established : get port and ip (backport #15686)

5 months agobgpd: fix addressing information of non established outgoing sessions
Philippe Guibert [Fri, 5 Apr 2024 07:55:05 +0000 (09:55 +0200)]
bgpd: fix addressing information of non established outgoing sessions

When trying to connect to a BGP peer that does not respons, the 'show
bgp neighbors' command does not give any indication on the local and
remote addresses used:

> # show bgp neighbors
>  BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link
>   Local Role: undefined
>   Remote Role: undefined
>   BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1
>   BGP state = Connect
> [..]
>   Connections established 0; dropped 0
>   Last reset 00:00:04,   Waiting for peer OPEN (n/a)
>   Internal BGP neighbor may be up to 255 hops away.
> BGP Connect Retry Timer in Seconds: 120
> Next connect timer due in 117 seconds
> Read thread: off  Write thread: off  FD used: 27

The addressing information (address and port) are only available
when TCP session is established, whereas this information is present
at the system level:

> root@ubuntu2204:~# netstat -pan | grep 192.0.2.1
> tcp        0      0 192.0.2.1:179           192.0.2.150:38060       SYN_RECV    -
> tcp        0      1 192.0.2.1:46526         192.0.2.150:179         SYN_SENT    488310/bgpd

Add the display for outgoing BGP session, as the information in
the getsockname() API provides information for connected streams.
When getpeername() API does not give any information, use the peer
configuration (destination port is encoded in peer->port).

> # show bgp neighbors
> BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link
>   Local Role: undefined
>   Remote Role: undefined
>   BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1
>   BGP state = Connect
> [..]
>   Connections established 0; dropped 0
>   Last reset 00:00:16,   Waiting for peer OPEN (n/a)
> Local host: 192.0.2.1, Local port: 46084
> Foreign host: 192.0.2.150, Foreign port: 179

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

5 months agobgpd: remove useless control checks about TCP connection
Philippe Guibert [Fri, 5 Apr 2024 11:52:27 +0000 (13:52 +0200)]
bgpd: remove useless control checks about TCP connection

When attempting to get the src and destination addresses of a given
connection, the API may return the NULL pointer, but further code
in bgp_zebra_nexthop_set() already does a check about the given
pointer.

Relaxing the error code for all the returned adressing.

Fixes: 1ff9a340588a ("bgpd: bgpd-fsm-fix.patch")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit ba7130309954fbe8d58854339ca43259149e603a)

5 months agoMerge pull request #17393 from opensourcerouting/fix/backport_17376_10.0
Donald Sharp [Fri, 8 Nov 2024 16:13:12 +0000 (11:13 -0500)]
Merge pull request #17393 from opensourcerouting/fix/backport_17376_10.0

bgpd: Clear stale routes with multiple paths (backport)

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>
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>
5 months agoMerge pull request #17349 from FRRouting/mergify/bp/stable/10.0/pr-17305
Donald Sharp [Tue, 5 Nov 2024 19:27:07 +0000 (14:27 -0500)]
Merge pull request #17349 from FRRouting/mergify/bp/stable/10.0/pr-17305

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

5 months agoMerge pull request #17354 from FRRouting/mergify/bp/stable/10.0/pr-17319
Donald Sharp [Tue, 5 Nov 2024 19:25:10 +0000 (14:25 -0500)]
Merge pull request #17354 from FRRouting/mergify/bp/stable/10.0/pr-17319

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

5 months agoospfd: Use router_id what Zebra has if we remove a static router_id
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
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 agoMerge pull request #17323 from FRRouting/mergify/bp/stable/10.0/pr-17318
Mark Stapp [Thu, 31 Oct 2024 17:26:11 +0000 (13:26 -0400)]
Merge pull request #17323 from FRRouting/mergify/bp/stable/10.0/pr-17318

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

5 months agoMerge pull request #17302 from FRRouting/mergify/bp/stable/10.0/pr-17250
Donatas Abraitis [Thu, 31 Oct 2024 15:21:22 +0000 (17:21 +0200)]
Merge pull request #17302 from FRRouting/mergify/bp/stable/10.0/pr-17250

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

5 months agozebra: Add missing new line for help string
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 agoisisd: fix change flex-algorithm number from uint32 to uint8
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 #17288 from opensourcerouting/16354-bp-10.0
Russ White [Tue, 29 Oct 2024 14:28:11 +0000 (10:28 -0400)]
Merge pull request #17288 from opensourcerouting/16354-bp-10.0

(10.0 backport) bgpd: add `bgp ipv6-auto-ra` command

5 months agoMerge pull request #17284 from FRRouting/mergify/bp/stable/10.0/pr-17278
Russ White [Tue, 29 Oct 2024 14:26:34 +0000 (10:26 -0400)]
Merge pull request #17284 from FRRouting/mergify/bp/stable/10.0/pr-17278

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

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

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

5 months agobgpd: fix crash when polling bgp4v2PathAttrTable
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 agobgpd: add `bgp ipv6-auto-ra` command
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>
6 months agobgpd: fix blank line in running-config with bmp listener cmd
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 #17274 from FRRouting/mergify/bp/stable/10.0/pr-17243
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 20:15:08 +0000 (15:15 -0500)]
Merge pull request #17274 from FRRouting/mergify/bp/stable/10.0/pr-17243

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

6 months agoMerge pull request #17260 from FRRouting/mergify/bp/stable/10.0/pr-17160
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 17:37:57 +0000 (12:37 -0500)]
Merge pull request #17260 from FRRouting/mergify/bp/stable/10.0/pr-17160

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

6 months agobgpd: fix display of local label in show bgp
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 #17247 from FRRouting/mergify/bp/stable/10.0/pr-17217
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 04:43:35 +0000 (23:43 -0500)]
Merge pull request #17247 from FRRouting/mergify/bp/stable/10.0/pr-17217

pimd: allow resolving bsr via directly connected secondary address (backport) (backport #17217)

6 months agolib, zebra: Keep `zebra on-rib-process script` in frr.conf
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 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 d23a7d0949aaa9aa95d6d3ae293ac4eea81e19f5)

6 months agoMerge pull request #17240 from opensourcerouting/fix/backport_d46511d4456ccaccfdac34b...
Jafar Al-Gharaibeh [Fri, 25 Oct 2024 15:18:58 +0000 (10:18 -0500)]
Merge pull request #17240 from opensourcerouting/fix/backport_d46511d4456ccaccfdac34b456c1c225a29609c8_10.0

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

6 months agobgpd: compare aigp after local route check in bgp_path_info_cmp()
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>
6 months agoMerge pull request #17206 from louis-6wind/fix-bgp-labels-10.0
Donatas Abraitis [Fri, 25 Oct 2024 04:12:52 +0000 (07:12 +0300)]
Merge pull request #17206 from louis-6wind/fix-bgp-labels-10.0

bgpd: fix uninitialized labels (backport 10.0)

6 months agoMerge pull request #17209 from cscarpitta/fix/backport_add-sid-structure-to-seg6local...
Donatas Abraitis [Thu, 24 Oct 2024 14:32:49 +0000 (17:32 +0300)]
Merge pull request #17209 from cscarpitta/fix/backport_add-sid-structure-to-seg6local-nh_for_10.0

bgpd, lib: Include SID structure in seg6local nexthop (backport for 10.0)

6 months agobgpd: Include structure when removing End.DT46 SID
Carmine Scarpitta [Sun, 15 Sep 2024 16:56:48 +0000 (18:56 +0200)]
bgpd: Include structure when removing End.DT46 SID

Include SID structure information when removing an SRv6 End.DT46 SID
from the forwarding plane.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
6 months agobgpd: Include structure when removing End.DT4/6 SID
Carmine Scarpitta [Sun, 15 Sep 2024 16:56:21 +0000 (18:56 +0200)]
bgpd: Include structure when removing End.DT4/6 SID

Include SID structure information when removing an SRv6 End.DT4 or End.DT6 SID
from the forwarding plane.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
6 months agobgpd: Include structure when installing End.DT46 SID
Carmine Scarpitta [Sun, 15 Sep 2024 16:54:55 +0000 (18:54 +0200)]
bgpd: Include structure when installing End.DT46 SID

Include SID structure information when installing an SRv6 End.DT46 SID
in the forwarding plane.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
6 months agobgpd: Include structure when installing End.DT4/6 SID
Carmine Scarpitta [Sun, 15 Sep 2024 16:53:35 +0000 (18:53 +0200)]
bgpd: Include structure when installing End.DT4/6 SID

Include SID structure information when installing an SRv6 End.DT6 or End.DT4 SID
in the forwarding plane.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
6 months agolib: Include SID structure in seg6local nexthop
Carmine Scarpitta [Sun, 15 Sep 2024 15:23:34 +0000 (17:23 +0200)]
lib: Include SID structure in seg6local nexthop

Include SID structure information in seg6local nexthop data structure.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
6 months agobgpd: fix uninitialized labels
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>
6 months agoMerge pull request #17203 from FRRouting/mergify/bp/stable/10.0/pr-17198
Donatas Abraitis [Wed, 23 Oct 2024 06:19:03 +0000 (09:19 +0300)]
Merge pull request #17203 from FRRouting/mergify/bp/stable/10.0/pr-17198

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

6 months agoMerge pull request #17197 from FRRouting/mergify/bp/stable/10.0/pr-17165
Russ White [Wed, 23 Oct 2024 01:16:34 +0000 (21:16 -0400)]
Merge pull request #17197 from FRRouting/mergify/bp/stable/10.0/pr-17165

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

6 months agoRevert "lib: Attach stdout to child only if --log=stdout and stdout FD is a tty"
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 agotests: Check if BGP no-export community is passed to BGP OAD peers
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 #17177 from FRRouting/mergify/bp/stable/10.0/pr-17169
Jafar Al-Gharaibeh [Tue, 22 Oct 2024 14:39:06 +0000 (09:39 -0500)]
Merge pull request #17177 from FRRouting/mergify/bp/stable/10.0/pr-17169

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

6 months agobgpd: allow value 0 in aigp-metric setting
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 #17131 from FRRouting/mergify/bp/stable/10.0/pr-17116
Donatas Abraitis [Fri, 18 Oct 2024 11:57:03 +0000 (14:57 +0300)]
Merge pull request #17131 from FRRouting/mergify/bp/stable/10.0/pr-17116

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

6 months agoMerge pull request #17148 from FRRouting/mergify/bp/stable/10.0/pr-17091
Jafar Al-Gharaibeh [Thu, 17 Oct 2024 16:29:54 +0000 (11:29 -0500)]
Merge pull request #17148 from FRRouting/mergify/bp/stable/10.0/pr-17091

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

6 months agoMerge pull request #17139 from FRRouting/mergify/bp/stable/10.0/pr-17020
Donatas Abraitis [Thu, 17 Oct 2024 11:27:06 +0000 (14:27 +0300)]
Merge pull request #17139 from FRRouting/mergify/bp/stable/10.0/pr-17020

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

6 months agotests: add a new topotest to bgp_aigp
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 agozebra: fix heap-use-after free on ns shutdown
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 agozebra: unlock node only after operation in zebra_free_rnh()
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 agoMerge pull request #17110 from FRRouting/mergify/bp/stable/10.0/pr-17093
Donald Sharp [Tue, 15 Oct 2024 20:28:06 +0000 (16:28 -0400)]
Merge pull request #17110 from FRRouting/mergify/bp/stable/10.0/pr-17093

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

6 months agotests: fix and adjust topotest/bgp_aigp
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 #17068 from FRRouting/mergify/bp/stable/10.0/pr-17059
Donald Sharp [Fri, 11 Oct 2024 16:14:36 +0000 (12:14 -0400)]
Merge pull request #17068 from FRRouting/mergify/bp/stable/10.0/pr-17059

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

6 months agobgpd: Move some non BGP-specific route-map functions to lib
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)

6 months agoMerge pull request #17034 from FRRouting/mergify/bp/stable/10.0/pr-17022
Donald Sharp [Tue, 8 Oct 2024 22:22:32 +0000 (18:22 -0400)]
Merge pull request #17034 from FRRouting/mergify/bp/stable/10.0/pr-17022

vrrpd: iterate over all ancillary messages (backport #17022)

6 months agovrrpd: iterate over all ancillary messages
Rafael Zalamena [Mon, 7 Oct 2024 16:02:44 +0000 (13:02 -0300)]
vrrpd: iterate over all ancillary messages

Assign the return of `CMSG_NXTHDR` so we can really iterate over the
ancillary data.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 5e1a3cd2ad1148f60f5a59474bcf3d176b9ab789)

6 months agoMerge pull request #17027 from FRRouting/mergify/bp/stable/10.0/pr-17014
Donald Sharp [Tue, 8 Oct 2024 13:32:01 +0000 (09:32 -0400)]
Merge pull request #17027 from FRRouting/mergify/bp/stable/10.0/pr-17014

isisd: fix wrong check for MT commands (backport #17014)

6 months agoisisd: fix wrong check for MT commands
anlan_cs [Sun, 6 Oct 2024 13:06:15 +0000 (21:06 +0800)]
isisd: fix wrong check for MT commands

```
anlan# show run
!
interface eth0
 ip router isis A
exit
!
router isis A
 metric-style narrow <- NOT wide
exit
!
end
anlan (config)# int eth0
anlan (config-if)# no isis topology ipv6-unicast
% Configuration failed.

Error type: validation
Error description: Multi topology IS-IS can only be used with wide metrics
```

The MT commands are mainly controlled by the binded area, not by interface.
Currently if there is any MT configuration in the area, `metric-style` must
be with the `wide` mode, this requirement is sufficient.  So, the
unnecessary/wrong check for MT in the interface should be removed.

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

6 months agoMerge pull request #17004 from FRRouting/mergify/bp/stable/10.0/pr-17000
Donatas Abraitis [Mon, 7 Oct 2024 10:27:46 +0000 (13:27 +0300)]
Merge pull request #17004 from FRRouting/mergify/bp/stable/10.0/pr-17000

zebra: Fix crash during reconnect (backport #17000)

6 months agozebra: Fix crash during reconnect
Igor Zhukov [Fri, 4 Oct 2024 06:16:02 +0000 (13:16 +0700)]
zebra: Fix crash during reconnect

fpm_enqueue_rmac_table expects an fpm_rmac_arg* as its argument.

The issue can be reproduced by dropping the TCP session using:

ss -K dst 127.0.0.1 dport = 2620

I used Fedora 40 and frr 9.1.2 and I got the gdb backtrace:

(gdb) bt
0  0x00007fdd7d6997ea in fpm_enqueue_rmac_table (bucket=0x2134dd0, arg=0x2132b60) at zebra/dplane_fpm_nl.c:1217
1  0x00007fdd7dd1560d in hash_iterate (hash=0x21335f0, func=0x7fdd7d6997a0 <fpm_enqueue_rmac_table>, arg=0x2132b60) at lib/hash.c:252
2  0x00007fdd7dd1560d in hash_iterate (hash=0x1e5bf10, func=func@entry=0x7fdd7d698900 <fpm_enqueue_l3vni_table>,
    arg=arg@entry=0x7ffed983bef0) at lib/hash.c:252
3  0x00007fdd7d698b5c in fpm_rmac_send (t=<optimized out>) at zebra/dplane_fpm_nl.c:1262
4  0x00007fdd7dd6ce22 in event_call (thread=thread@entry=0x7ffed983c010) at lib/event.c:1970
5  0x00007fdd7dd20758 in frr_run (master=0x1d27f10) at lib/libfrr.c:1213
6  0x0000000000425588 in main (argc=10, argv=0x7ffed983c2e8) at zebra/main.c:492

Signed-off-by: Igor Zhukov <fsb4000@yandex.ru>
(cherry picked from commit a3877e4444dc3a1253135d3b9479935fc9a966f8)

6 months agoMerge pull request #16997 from FRRouting/mergify/bp/stable/10.0/pr-16934
Donald Sharp [Fri, 4 Oct 2024 11:41:27 +0000 (07:41 -0400)]
Merge pull request #16997 from FRRouting/mergify/bp/stable/10.0/pr-16934

*: Modify clang-format column limit to 100 (backport #16934)

6 months ago*: Modify clang-format column limit to 100
Donald Sharp [Thu, 26 Sep 2024 13:57:28 +0000 (09:57 -0400)]
*: Modify clang-format column limit to 100

A bunch of recent discussion has gone on about this.  Let's see
if we are actually interested in making a change.

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

6 months agoMerge pull request #16983 from FRRouting/mergify/bp/stable/10.0/pr-16977
Donatas Abraitis [Thu, 3 Oct 2024 09:54:22 +0000 (12:54 +0300)]
Merge pull request #16983 from FRRouting/mergify/bp/stable/10.0/pr-16977

bgpd: fix printfrr_bp for non initialized peers (backport #16977)

6 months agoMerge pull request #16979 from FRRouting/mergify/bp/stable/10.0/pr-16971
Donatas Abraitis [Thu, 3 Oct 2024 07:51:15 +0000 (10:51 +0300)]
Merge pull request #16979 from FRRouting/mergify/bp/stable/10.0/pr-16971

bgpd: Actually make ` --v6-with-v4-nexthops` it work (backport #16971)

6 months agobgpd: fix printfrr_bp for non initialized peers
Louis Scalbert [Wed, 2 Oct 2024 12:38:15 +0000 (14:38 +0200)]
bgpd: fix printfrr_bp for non initialized peers

Fix printfrr_bp for non initialized peers. For example:

> Sep 26 17:56:44 r1 bgpd[26295]: [GJPH1-W8PZV] Resetting peer (null)(Unknown) due to change in addpath config

Is now:

> Oct 02 14:00:59 r1 bgpd[12795]: [MNE5N-K0G4Z] Resetting peer 2.2.2.2 due to change in addpath config

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit b56cfc6c808d330a85a06421c7fc5f5f9066938f)

6 months agoMerge pull request #16719 from FRRouting/mergify/bp/stable/10.0/pr-16699
Donatas Abraitis [Thu, 3 Oct 2024 06:33:41 +0000 (09:33 +0300)]
Merge pull request #16719 from FRRouting/mergify/bp/stable/10.0/pr-16699

nhrpd, test: fix nhrp_redundancy topotest (backport #16698) (backport #16699)

6 months agobgpd: Actually make ` --v6-with-v4-nexthops` it work
Donatas Abraitis [Wed, 2 Oct 2024 10:57:30 +0000 (13:57 +0300)]
bgpd: Actually make ` --v6-with-v4-nexthops` it work

It was using `-v` which is actually a _version_.

Fixes: 0435b31bb8ed55377f83d0e19bc085abc3c71b44 ("bgpd: Allow bgp to specify if it will allow v6 routing with v4 nexthops")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 0495cac837ad0f6ff1082746c37e4a48c1068035)

6 months agoMerge pull request #16974 from FRRouting/mergify/bp/stable/10.0/pr-16968
Donald Sharp [Wed, 2 Oct 2024 15:07:37 +0000 (11:07 -0400)]
Merge pull request #16974 from FRRouting/mergify/bp/stable/10.0/pr-16968

bfdd: add no variants to interval configurations (backport #16968)

6 months agobfdd: add no variants to interval configurations
Rafael Zalamena [Tue, 1 Oct 2024 21:58:24 +0000 (18:58 -0300)]
bfdd: add no variants to interval configurations

Add missing no commands to various interval configurations.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit b70835d690d98f1549202d89d9bab34297ba5bd0)

6 months agoMerge pull request #16965 from FRRouting/mergify/bp/stable/10.0/pr-16738
Donald Sharp [Tue, 1 Oct 2024 16:24:20 +0000 (12:24 -0400)]
Merge pull request #16965 from FRRouting/mergify/bp/stable/10.0/pr-16738

lib: Attach stdout to child only if --log=stdout and stdout FD is a tty (backport #16738)

6 months agolib: Attach stdout to child only if --log=stdout and stdout FD is a tty
Vladislav Odintsov [Wed, 4 Sep 2024 11:18:35 +0000 (14:18 +0300)]
lib: Attach stdout to child only if --log=stdout and stdout FD is a tty

Prior to this commit stdout of a process started in a daemon mode was
attached to a calling process.
As a result a calling process hung for infinity.

Signed-off-by: Vladislav Odintsov <vlodintsov@k2.cloud>
(cherry picked from commit 0e3c5e8e5907321b35201f0985c1d3f4a1b0e639)

7 months agoMerge pull request #16920 from FRRouting/mergify/bp/stable/10.0/pr-16918
Donald Sharp [Wed, 25 Sep 2024 21:56:56 +0000 (17:56 -0400)]
Merge pull request #16920 from FRRouting/mergify/bp/stable/10.0/pr-16918

zebra snmp fixes (backport #16918)

7 months agoMerge pull request #16926 from FRRouting/mergify/bp/stable/10.0/pr-16913
Donald Sharp [Wed, 25 Sep 2024 21:56:26 +0000 (17:56 -0400)]
Merge pull request #16926 from FRRouting/mergify/bp/stable/10.0/pr-16913

bgpd: EVPN fix per rd specific type-2 json output (backport #16913)

7 months agobgpd: EVPN fix per rd specific type-2 json output
Sindhu Parvathi Gopinathan [Tue, 24 Sep 2024 17:55:09 +0000 (10:55 -0700)]
bgpd: EVPN fix per rd specific type-2 json output

Current Issue:

paths key is not there for
'show bgp l2vpn evpn route rd <rd-id> mac <mac> json' uses
evpn prefix as key for each path.
Replace the evpn prefix with "paths".
This aligned with overall EVPN RIB json output like
'show bgp l2vpn evpn route json'
'show bgp l2vpn evpn route rd <> type 2 json'

Fix:

paths key is added instead of prefix info.

Ticket:#4087461

Issue:4087461

Testing:

Before fix:

leaf22# show bgp l2vpn evpn route rd 6.0.0.17:2 mac 00:02:00:00:00:12 json
{
  "prefix":"[2]:[0]:[48]:[00:02:00:00:00:12]",
  "prefixLen":352,
  "rd":"6.0.0.17:2",
  "routeType":2,
  "ethTag":0,
  "macLen":48,
  "mac":"00:02:00:00:00:12",
  "advertisedTo":{
    "220.20.0.33":{
      "hostname":"spine21"
    },
    "220.21.0.33":{
      "hostname":"spine22"
    }
  },
  "[2]:[0]:[48]:[00:02:00:00:00:12]":[ <=====  Prefix info instead of "paths" key
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":5,
        "bestpath":{
          "bestpathFromAs":65202,
          "overall":true,
          "selectionReason":"Older Path"
        },
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1726803218,
          "string":"Fri Sep 20 03:33:38 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine21",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.20.0.33",
          "routerId":"6.0.0.20",
          "hostname":"spine21",
          "type":"external"
        }
      }
    ],
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":5,
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1726803218,
          "string":"Fri Sep 20 03:33:38 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine22",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.21.0.33",
          "routerId":"6.0.0.21",
          "hostname":"spine22",
          "type":"external"
        }
      }
    ]
  ],
  "numPaths":2
}

After fix:

eaf22# show bgp l2vpn evpn route rd 6.0.0.17:2 mac 00:02:00:00:00:12 json
{
  "prefix":"[2]:[0]:[48]:[00:02:00:00:00:12]",
  "prefixLen":352,
  "rd":"6.0.0.17:2",
  "routeType":2,
  "ethTag":0,
  "macLen":48,
  "mac":"00:02:00:00:00:12",
  "advertisedTo":{
    "220.20.0.33":{
      "hostname":"spine21"
    },
    "220.21.0.33":{
      "hostname":"spine22"
    }
  },
  "paths":[
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":3,
        "bestpath":{
          "bestpathFromAs":65202,
          "overall":true,
          "selectionReason":"Router ID"
        },
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1727175046,
          "string":"Tue Sep 24 10:50:46 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine21",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.20.0.33",
          "routerId":"6.0.0.20",
          "hostname":"spine21",
          "type":"external"
        }
      }
    ],
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":3,
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1727175046,
          "string":"Tue Sep 24 10:50:46 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine22",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.21.0.33",
          "routerId":"6.0.0.21",
          "hostname":"spine22",
          "type":"external"
        }
      }
    ]
  ],
  "numPaths":2
}

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
(cherry picked from commit ff008cee6b5b4945f6dd3e58b46b933d695c2865)

7 months agozebra: Add missing proto translations
Donald Sharp [Wed, 25 Sep 2024 16:14:50 +0000 (12:14 -0400)]
zebra: Add missing proto translations

Add missing isis and eigrp proto translations.

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

7 months agozebra: Correctly report metrics
Donald Sharp [Wed, 25 Sep 2024 16:09:40 +0000 (12:09 -0400)]
zebra: Correctly report metrics

Report the routes metric in IPFORWARDMETRIC1 and return
-1 for the other metrics as required by the IP-FORWARD-MIB.

inetCidrRouteMetric2 OBJECT-TYPE
    SYNTAX     Integer32
    MAX-ACCESS read-create
    STATUS     current
    DESCRIPTION
           "An alternate routing metric for this route.  The
            semantics of this metric are determined by the routing-
            protocol specified in the route's inetCidrRouteProto
            value.  If this metric is not used, its value should be
            set to -1."
    DEFVAL { -1 }
    ::= { inetCidrRouteEntry 13 }

I've included metric2 but it's the same for all of them.

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

7 months agozebra: Let's use memset instead of walking bytes and setting to 0
Donald Sharp [Wed, 25 Sep 2024 16:08:03 +0000 (12:08 -0400)]
zebra: Let's use memset instead of walking bytes and setting to 0

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

7 months agozebra: Fix snmp walk of zebra rib
Donald Sharp [Wed, 25 Sep 2024 16:06:29 +0000 (12:06 -0400)]
zebra: Fix snmp walk of zebra rib

The snmp walk of the zebra rib was skipping entries
because in_addr_cmp was replaced with a prefix_cmp
which worked slightly differently causing parts
of the zebra rib tree to be skipped.

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

7 months agoMerge pull request #16898 from FRRouting/mergify/bp/stable/10.0/pr-16630
Russ White [Tue, 24 Sep 2024 14:58:21 +0000 (10:58 -0400)]
Merge pull request #16898 from FRRouting/mergify/bp/stable/10.0/pr-16630

Babel metric (backport #16630)

7 months agobabeld: Do not remove route when replacing
Donald Sharp [Thu, 22 Aug 2024 14:24:42 +0000 (10:24 -0400)]
babeld: Do not remove route when replacing

When sending down a babel route do not remove then
add it back.  Just send down the change.  This
change will not cause packets to be dropped now.

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

7 months agobabeld: Send the route's metric down to zebra.
Donald Sharp [Thu, 22 Aug 2024 14:22:58 +0000 (10:22 -0400)]
babeld: Send the route's metric down to zebra.

Babel was thinking it was talking to the kernel for
route installation instead of zebra.  Pass down the
metric instead.

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

7 months agoMerge pull request #16863 from FRRouting/mergify/bp/stable/10.0/pr-16860
Jafar Al-Gharaibeh [Thu, 19 Sep 2024 13:50:50 +0000 (08:50 -0500)]
Merge pull request #16863 from FRRouting/mergify/bp/stable/10.0/pr-16860

ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV (backport #16860)

7 months agoospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV
Acee Lindem [Wed, 18 Sep 2024 18:09:19 +0000 (18:09 +0000)]
ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV

When parsing the SR-Algorithm TLV in the OSPF Router Information Opaque
LSA, assure that not more than the maximum number of supported
algorithms are copied from the TLV.

Signed-off-by: Acee Lindem <acee@lindem.com>
(cherry picked from commit 0dc969185fdd75fd007c9b29e11be57a078236df)