]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
2 months agobgpd: don't reuse nexthop variable in loop/switch
David Lamparter [Wed, 22 Jan 2025 10:13:21 +0000 (11:13 +0100)]
bgpd: don't reuse nexthop variable in loop/switch

While the loop is currently exited in all cases after using nexthop, it
is a footgun to have "nh" around to be reused in another iteration of
the loop.  This would leave nexthop with partial data from the previous
use.  Make it local where needed instead.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit ce7f5b21221f0b3557d1f4a40793230d8bc4cf02)

3 months agoMerge pull request #17818 from FRRouting/mergify/bp/stable/9.1/pr-17807
Donatas Abraitis [Fri, 10 Jan 2025 09:46:01 +0000 (11:46 +0200)]
Merge pull request #17818 from FRRouting/mergify/bp/stable/9.1/pr-17807

bgpd: fix crash in displaying json orf prefix-list (backport #17807)

3 months agobgpd: fix crash in displaying json orf prefix-list 17818/head
Louis Scalbert [Thu, 9 Jan 2025 17:28:53 +0000 (18:28 +0100)]
bgpd: fix crash in displaying json orf prefix-list

bgpd crashes when there is several entries in the prefix-list. No
backtrace is provided because the issue was catched from a code review.

Fixes: 856ca177c4 ("Added json formating support to show-...-neighbors-... bgp commands.")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 8ccf60921b85893d301186a0f8156fb702da379f)

3 months agobgpd: fix bgp orf prefix-list json prefix
Louis Scalbert [Thu, 9 Jan 2025 17:24:39 +0000 (18:24 +0100)]
bgpd: fix bgp orf prefix-list json prefix

0x<address>FX was displayed instead of the prefix.

Fixes: b219dda129 ("lib: Convert usage of strings to %pFX and %pRN")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit b7e843d7e8afe57d3815dbb44e30307654e73711)

3 months agoMerge pull request #17791 from FRRouting/mergify/bp/stable/9.1/pr-17725
Donald Sharp [Tue, 7 Jan 2025 18:07:53 +0000 (13:07 -0500)]
Merge pull request #17791 from FRRouting/mergify/bp/stable/9.1/pr-17725

isisd: Allow full `no` form for `domain-password` and `area-password` (backport #17725)

3 months agoisisd: Allow full `no` form for `domain-password` and `area-password` 17791/head
Donatas Abraitis [Thu, 26 Dec 2024 15:33:03 +0000 (17:33 +0200)]
isisd: Allow full `no` form for `domain-password` and `area-password`

Before:

```
LR1.wue3(config)# router isis VyOS
LR1.wue3(config-router)# no  area-password clear
% Unknown command: no  area-password clear
LR1.wue3(config-router)# no  area-password clear foo
% Unknown command: no  area-password clear foo
LR1.wue3(config-router)#
```

Closes https://github.com/FRRouting/frr/issues/17722

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

3 months agoMerge pull request #17758 from FRRouting/mergify/bp/stable/9.1/pr-17732
Donatas Abraitis [Sat, 4 Jan 2025 11:49:55 +0000 (13:49 +0200)]
Merge pull request #17758 from FRRouting/mergify/bp/stable/9.1/pr-17732

isisd: Show correct level information for `show isis interface detail json` (backport #17732)

3 months agoisisd: Show correct level information for `show isis interface detail json` 17758/head
Donatas Abraitis [Mon, 30 Dec 2024 08:31:44 +0000 (10:31 +0200)]
isisd: Show correct level information for `show isis interface detail json`

Having this configuration:

```
!
interface r1-eth0
 ip address 10.0.0.1/30
 ip router isis 1
 isis priority 44 level-1
 isis priority 88 level-2
 isis csnp-interval 90 level-1
 isis csnp-interval 99 level-2
 isis psnp-interval 70 level-1
 isis psnp-interval 50 level-2
 isis hello-interval level-1 120
 isis hello-interval level-2 150

!
interface r1-eth1
 ip address 10.0.0.10/30
 ip router isis 1
!
interface lo
 ip address 192.0.2.1/32
 ip router isis 1
 isis passive
!
router isis 1
net 49.0000.0000.0000.0001.00
 metric-style wide
```

Produces:

```
{
 "areas":[
   {
     "area":"1",
     "circuits":[
       {
         "circuit":2,
         "interface":{
           "name":"r1-eth0",
           "state":"Up",
           "is-passive":"active",
           "circuit-id":"0x2",
           "type":"lan",
           "level":"L1L2",
           "snpa":"6e28.9c92.da5e",
           "levels":[
             {
               "level":"L1",
               "metric":10,
               "active-neighbors":1,
               "hello-interval":120,
               "holddown":{
                 "count":10,
                 "pad":"yes"
               },
               "cnsp-interval":90,
               "psnp-interval":70,
               "lan":{
                 "priority":44,
                 "is-dis":"no"
               }
             },
             {
               "level":"L2",
               "metric":10,
               "active-neighbors":1,
               "hello-interval":120, <<<<<<<<<<<<<<<<<<
               "holddown":{
                 "count":10,
                 "pad":"yes"
               },
               "cnsp-interval":90, <<<<<<<<<<<<<<<<<<
               "psnp-interval":70, <<<<<<<<<<<<<<<<<<
               "lan":{
                 "priority":44, <<<<<<<<<<<<<<<<<<
                 "is-dis":"no"
               }
             }
           ],
...
```

Fixes: 9fee4d4c6038ef6b14e9f509d6b04d189660c4cd ("isisd: Add json to show isis interface command.")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 360a0d6f4ca68fda0eb5d64a8633018a3b5a4a1d)

3 months agoMerge pull request #16864 from FRRouting/mergify/bp/stable/9.1/pr-16860
Donatas Abraitis [Thu, 2 Jan 2025 11:10:19 +0000 (13:10 +0200)]
Merge pull request #16864 from FRRouting/mergify/bp/stable/9.1/pr-16860

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

4 months agoFRR Release 9.1.3 rc/9.1.3 docker/9.1.3 frr-9.1.3
Donatas Abraitis [Fri, 27 Dec 2024 20:57:30 +0000 (22:57 +0200)]
FRR Release 9.1.3

- bfdd
-   Add no variants to interval configurations
- bgpd
-   Actually make ` --v6-with-v4-nexthops` it work
-   Add `bgp ipv6-auto-ra` command
-   Allow value 0 in aigp-metric setting
-   Clear all paths including addpath once GR expires
-   Compare aigp after local route check in bgp_path_info_cmp()
-   EVPN fix per rd specific type-2 json output
-   Fix addressing information of non established outgoing sessions
-   Fix bgp core with a possible Intf delete
-   Fix blank line in running-config with bmp listener cmd
-   Fix crash when polling bgp4v2PathAttrTable
-   Fix display of local label in show bgp
-   Fix for match source-protocol in route-map for redistribute cmd
-   Fix memory leak when creating BMP connection with a source interface
-   Fix printfrr_bp for non initialized peers
-   Fix route selection with AIGP
-   Fix several issues in sourcing AIGP attribute
-   Fix unconfigure asdot neighbor
-   Include structure when installing End.DT4/6 SID
-   Include structure when installing End.DT46 SID
-   Include structure when removing End.DT4/6 SID
-   Include structure when removing End.DT46 SID
-   Move some non BGP-specific route-map functions to lib
-   Remove useless control checks about TCP connection
-   Set LLGR stale routes for all the paths including addpath
-   Treat numbered community-list only if it's in a range 1-500
-   Validate both nexthop information (NEXTHOP and NLRI)
- isisd
-   Fix rcap tlv double-free crash
- lib
-   Include SID structure in seg6local nexthop
-   Take ge/le into consideration when checking the prefix with the prefix-list
-   Keep `zebra on-rib-process script` in frr.conf
- nhrpd
-   Fixes duplicate auth extension
- ospfd
-   Fix missing '[no]ip ospf graceful-restart hello-delay <N>' commands
- pimd
-   Allow resolving bsr via directly connected secondary address
-   Fix access-list memory leak in pimd
- vrrpd
-   Iterate over all ancillary messages
- zebra
-   Add missing new line for help string
-   Add missing proto translations
-   Correctly report metrics
-   Fix crash during reconnect
-   Fix snmp walk of zebra rib
-   Let's use memset instead of walking bytes and setting to 0
-   Separate zebra ZAPI server open and accept
-   Unlock node only after operation in zebra_free_rnh()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agoMerge pull request #17681 from FRRouting/mergify/bp/stable/9.1/pr-17675
Donatas Abraitis [Fri, 20 Dec 2024 12:40:24 +0000 (14:40 +0200)]
Merge pull request #17681 from FRRouting/mergify/bp/stable/9.1/pr-17675

bgpd: Fix memory leak when creating BMP connection with a source interface (backport #17675)

4 months agobgpd: Fix memory leak when creating BMP connection with a source interface 17681/head
Donatas Abraitis [Thu, 19 Dec 2024 08:56:52 +0000 (10:56 +0200)]
bgpd: Fix memory leak when creating BMP connection with a source interface

Testing done with:

```
for x in $(seq 1 100000); do vtysh -c 'conf' -c 'router bgp' -c 'bmp targets test' -c 'bmp connect localhost port 123 min-retry 100 max-retry 100 source-interface lo'; done
```

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

4 months agoMerge pull request #17659 from FRRouting/mergify/bp/stable/9.1/pr-17615
Jafar Al-Gharaibeh [Wed, 18 Dec 2024 00:39:06 +0000 (18:39 -0600)]
Merge pull request #17659 from FRRouting/mergify/bp/stable/9.1/pr-17615

lib: Take ge/le into consideration when checking the prefix with the prefix-list (backport #17615)

4 months agolib: Take ge/le into consideration when checking the prefix with the prefix-list 17659/head
Donatas Abraitis [Tue, 10 Dec 2024 14:28:26 +0000 (16:28 +0200)]
lib: Take ge/le into consideration when checking the prefix with the prefix-list

Without the fix:

```
show ip prefix-list test_1 10.20.30.96/27 first-match
 <no result>

show ip prefix-list test_2 192.168.1.2/32 first-match
 <no result>
```

With the fix:

```
ip prefix-list test_1 seq 10 permit 10.20.30.64/26 le 27
!
end
donatas# show ip prefix-list test_1 10.20.30.96/27
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 1, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.64/27
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 2, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.64/28
donatas# show ip prefix-list test_1 10.20.30.126/26
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 3, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.126/30
donatas#
```

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

4 months agoMerge pull request #17633 from opensourcerouting/fix/backport_9b0b9282d317a9aeab36d9a...
Donald Sharp [Wed, 11 Dec 2024 12:20:27 +0000 (07:20 -0500)]
Merge pull request #17633 from opensourcerouting/fix/backport_9b0b9282d317a9aeab36d9a8b08a35fe9a172c4b_9.1

bgpd: Fix bgp core with a possible Intf delete (backport)

4 months agobgpd: Fix bgp core with a possible Intf delete 17633/head
Rajasekar Raja [Tue, 10 Dec 2024 21:45:02 +0000 (13:45 -0800)]
bgpd: Fix bgp core with a possible Intf delete

Although trigger unknown, based on the backtrace in one of the internal
testing, we do see some delete in the Intf where we can have the peer
ifp pointer null and we try to dereference it while trying to install
the route leading to a crash

Skip updating the ifindex in such cases and since the nexthop is not
properly updated, BGP skips sending it to zebra.

BackTrace:
0  0x00007faef05e7ebc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007faef0598fb2 in raise () from /lib/x86_64-linux-gnu/libc.so.6
2  0x00007faef09900dc in core_handler (signo=11, siginfo=0x7ffdde8cb4b0, context=<optimized out>) at lib/sigevent.c:274
3  <signal handler called>
4  0x00005560aad4b7d8 in update_ipv6nh_for_route_install (api_nh=0x7ffdde8cbe94, is_evpn=false, best_pi=0x5560b21187d0, pi=0x5560b21187d0, ifindex=0, nexthop=0x5560b03cb0dc,
   nh_bgp=0x5560ace04df0, nh_othervrf=0) at bgpd/bgp_zebra.c:1273
5  bgp_zebra_announce_actual (dest=dest@entry=0x5560afcfa950, info=0x5560b21187d0, bgp=0x5560ace04df0) at bgpd/bgp_zebra.c:1521
6  0x00005560aad4bc85 in bgp_handle_route_announcements_to_zebra (e=<optimized out>) at bgpd/bgp_zebra.c:1896
7  0x00007faef09a1c0d in thread_call (thread=thread@entry=0x7ffdde8d7580) at lib/thread.c:2008
8  0x00007faef095a598 in frr_run (master=0x5560ac7e5190) at lib/libfrr.c:1223
9  0x00005560aac65db6 in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:557

(gdb) f 4
4  0x00005560aad4b7d8 in update_ipv6nh_for_route_install (api_nh=0x7ffdde8cbe94, is_evpn=false, best_pi=0x5560b21187d0, pi=0x5560b21187d0, ifindex=0, nexthop=0x5560b03cb0dc,
    nh_bgp=0x5560ace04df0, nh_othervrf=0) at bgpd/bgp_zebra.c:1273
1273 in bgpd/bgp_zebra.c
(gdb) p pi->peer->ifp
$26 = (struct interface *) 0x0

Ticket :#4203904

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
4 months agoMerge pull request #17597 from opensourcerouting/fix/backport_12a9ca4de6c781b061cccdf...
Jafar Al-Gharaibeh [Thu, 5 Dec 2024 15:25:40 +0000 (09:25 -0600)]
Merge pull request #17597 from opensourcerouting/fix/backport_12a9ca4de6c781b061cccdf3e793346e23558901_9.1

bgpd: fix unconfigure asdot neighbor (backport)

4 months agobgpd: fix unconfigure asdot neighbor 17597/head
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 #17561 from FRRouting/mergify/bp/stable/9.1/pr-17313
Mark Stapp [Wed, 4 Dec 2024 16:40:30 +0000 (11:40 -0500)]
Merge pull request #17561 from FRRouting/mergify/bp/stable/9.1/pr-17313

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

4 months agoMerge pull request #17565 from FRRouting/mergify/bp/stable/9.1/pr-17518
Jafar Al-Gharaibeh [Wed, 4 Dec 2024 01:51:15 +0000 (19:51 -0600)]
Merge pull request #17565 from FRRouting/mergify/bp/stable/9.1/pr-17518

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

4 months agopimd: Fix access-list memory leak in pimd 17565/head
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 17561/head
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 #17449 from opensourcerouting/fix/backport_65a43b57efd60c4fdf80c93...
Donald Sharp [Tue, 19 Nov 2024 14:29:39 +0000 (09:29 -0500)]
Merge pull request #17449 from opensourcerouting/fix/backport_65a43b57efd60c4fdf80c935750046ba861ec79f_9.1

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

5 months agobgpd: Validate both nexthop information (NEXTHOP and NLRI) 17449/head
Donatas Abraitis [Sun, 17 Nov 2024 09:27:31 +0000 (11:27 +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 #17418 from FRRouting/mergify/bp/stable/9.1/pr-17402
Jafar Al-Gharaibeh [Tue, 12 Nov 2024 22:06:43 +0000 (16:06 -0600)]
Merge pull request #17418 from FRRouting/mergify/bp/stable/9.1/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 17418/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)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit f93e5aa1663d9b375e0673f4eed367f9a009fa88)

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

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

5 months agobgpd: fix addressing information of non established outgoing sessions 17406/head
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 #17394 from opensourcerouting/fix/backport_17376_9.1
Donald Sharp [Fri, 8 Nov 2024 16:13:24 +0000 (11:13 -0500)]
Merge pull request #17394 from opensourcerouting/fix/backport_17376_9.1

bgpd: Clear stale routes with multiple paths (backport)

5 months agobgpd: Set LLGR stale routes for all the paths including addpath 17394/head
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 #17350 from FRRouting/mergify/bp/stable/9.1/pr-17305
Donald Sharp [Tue, 5 Nov 2024 19:26:50 +0000 (14:26 -0500)]
Merge pull request #17350 from FRRouting/mergify/bp/stable/9.1/pr-17305

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

5 months agobgpd: Treat numbered community-list only if it's in a range 1-500 17350/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 agoMerge pull request #17324 from FRRouting/mergify/bp/stable/9.1/pr-17318
Jafar Al-Gharaibeh [Thu, 31 Oct 2024 15:42:39 +0000 (10:42 -0500)]
Merge pull request #17324 from FRRouting/mergify/bp/stable/9.1/pr-17318

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

5 months agozebra: Add missing new line for help string 17324/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 #17289 from opensourcerouting/16354-bp-9.1
Russ White [Tue, 29 Oct 2024 14:28:04 +0000 (10:28 -0400)]
Merge pull request #17289 from opensourcerouting/16354-bp-9.1

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

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

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

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

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

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

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

6 months agoMerge pull request #17263 from opensourcerouting/fix/backport_1fe1f8d87c4ab46ae18536a...
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 17:38:34 +0000 (12:38 -0500)]
Merge pull request #17263 from opensourcerouting/fix/backport_1fe1f8d87c4ab46ae18536a2418c05ae5fd95185_9.1

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

6 months agobgpd: fix display of local label in show bgp 17275/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 agolib, zebra: Keep `zebra on-rib-process script` in frr.conf 17263/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>
6 months agoMerge pull request #17249 from FRRouting/mergify/bp/stable/9.1/pr-17217
Jafar Al-Gharaibeh [Sat, 26 Oct 2024 18:58:04 +0000 (13:58 -0500)]
Merge pull request #17249 from FRRouting/mergify/bp/stable/9.1/pr-17217

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

6 months agopimd: allow resolving bsr via directly connected secondary address 17249/head
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 #17241 from opensourcerouting/fix/backport_d46511d4456ccaccfdac34b...
Jafar Al-Gharaibeh [Fri, 25 Oct 2024 15:19:08 +0000 (10:19 -0500)]
Merge pull request #17241 from opensourcerouting/fix/backport_d46511d4456ccaccfdac34b456c1c225a29609c8_9.1

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() 17241/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>
6 months agoMerge pull request #17210 from cscarpitta/fix/backport_add-sid-structure-to-seg6local...
Donatas Abraitis [Thu, 24 Oct 2024 14:33:26 +0000 (17:33 +0300)]
Merge pull request #17210 from cscarpitta/fix/backport_add-sid-structure-to-seg6local-nh_for_9.1

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

6 months agobgpd: Include structure when removing End.DT46 SID 17210/head
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 agoMerge pull request #17204 from FRRouting/mergify/bp/stable/9.1/pr-17198
Donatas Abraitis [Wed, 23 Oct 2024 06:19:07 +0000 (09:19 +0300)]
Merge pull request #17204 from FRRouting/mergify/bp/stable/9.1/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" 17204/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 #17178 from FRRouting/mergify/bp/stable/9.1/pr-17169
Jafar Al-Gharaibeh [Tue, 22 Oct 2024 14:39:18 +0000 (09:39 -0500)]
Merge pull request #17178 from FRRouting/mergify/bp/stable/9.1/pr-17169

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

6 months agobgpd: allow value 0 in aigp-metric setting 17178/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 #17149 from FRRouting/mergify/bp/stable/9.1/pr-17091
Jafar Al-Gharaibeh [Thu, 17 Oct 2024 16:30:13 +0000 (11:30 -0500)]
Merge pull request #17149 from FRRouting/mergify/bp/stable/9.1/pr-17091

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

6 months agotests: add a new topotest to bgp_aigp 17149/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 #17132 from FRRouting/mergify/bp/stable/9.1/pr-17116
Jafar Al-Gharaibeh [Wed, 16 Oct 2024 14:25:00 +0000 (09:25 -0500)]
Merge pull request #17132 from FRRouting/mergify/bp/stable/9.1/pr-17116

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

6 months agozebra: unlock node only after operation in zebra_free_rnh() 17132/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 agoMerge pull request #17111 from FRRouting/mergify/bp/stable/9.1/pr-17093
Donald Sharp [Tue, 15 Oct 2024 20:27:45 +0000 (16:27 -0400)]
Merge pull request #17111 from FRRouting/mergify/bp/stable/9.1/pr-17093

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

6 months agotests: fix and adjust topotest/bgp_aigp 17111/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 #16927 from FRRouting/mergify/bp/stable/9.1/pr-16913
Donatas Abraitis [Mon, 14 Oct 2024 05:28:21 +0000 (08:28 +0300)]
Merge pull request #16927 from FRRouting/mergify/bp/stable/9.1/pr-16913

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

6 months agoMerge pull request #17069 from FRRouting/mergify/bp/stable/9.1/pr-17059
Donald Sharp [Fri, 11 Oct 2024 16:14:22 +0000 (12:14 -0400)]
Merge pull request #17069 from FRRouting/mergify/bp/stable/9.1/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 17069/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)

6 months agoMerge pull request #17035 from FRRouting/mergify/bp/stable/9.1/pr-17022
Donatas Abraitis [Thu, 10 Oct 2024 06:37:20 +0000 (09:37 +0300)]
Merge pull request #17035 from FRRouting/mergify/bp/stable/9.1/pr-17022

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

6 months agovrrpd: iterate over all ancillary messages 17035/head
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 #17005 from FRRouting/mergify/bp/stable/9.1/pr-17000
Donatas Abraitis [Tue, 8 Oct 2024 05:13:02 +0000 (08:13 +0300)]
Merge pull request #17005 from FRRouting/mergify/bp/stable/9.1/pr-17000

zebra: Fix crash during reconnect (backport #17000)

6 months agoMerge pull request #16981 from FRRouting/mergify/bp/stable/9.1/pr-16971
Donatas Abraitis [Mon, 7 Oct 2024 08:27:43 +0000 (11:27 +0300)]
Merge pull request #16981 from FRRouting/mergify/bp/stable/9.1/pr-16971

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

6 months agoMerge pull request #16975 from FRRouting/mergify/bp/stable/9.1/pr-16968
Donatas Abraitis [Mon, 7 Oct 2024 08:27:27 +0000 (11:27 +0300)]
Merge pull request #16975 from FRRouting/mergify/bp/stable/9.1/pr-16968

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

6 months agozebra: Fix crash during reconnect 17005/head
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 #16998 from FRRouting/mergify/bp/stable/9.1/pr-16934
Donald Sharp [Fri, 4 Oct 2024 11:41:46 +0000 (07:41 -0400)]
Merge pull request #16998 from FRRouting/mergify/bp/stable/9.1/pr-16934

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

6 months ago*: Modify clang-format column limit to 100 16998/head
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 #16984 from FRRouting/mergify/bp/stable/9.1/pr-16977
Donatas Abraitis [Thu, 3 Oct 2024 06:28:16 +0000 (09:28 +0300)]
Merge pull request #16984 from FRRouting/mergify/bp/stable/9.1/pr-16977

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

6 months agobgpd: fix printfrr_bp for non initialized peers 16984/head
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 agobgpd: Actually make ` --v6-with-v4-nexthops` it work 16981/head
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 agobfdd: add no variants to interval configurations 16975/head
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 #16921 from FRRouting/mergify/bp/stable/9.1/pr-16918
Donald Sharp [Tue, 1 Oct 2024 22:02:18 +0000 (18:02 -0400)]
Merge pull request #16921 from FRRouting/mergify/bp/stable/9.1/pr-16918

zebra snmp fixes (backport #16918)

6 months agoMerge pull request #16966 from FRRouting/mergify/bp/stable/9.1/pr-16738
Donald Sharp [Tue, 1 Oct 2024 21:52:38 +0000 (17:52 -0400)]
Merge pull request #16966 from FRRouting/mergify/bp/stable/9.1/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 16966/head
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 agobgpd: EVPN fix per rd specific type-2 json output 16927/head
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 16921/head
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 agoospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV 16864/head
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)

7 months agoMerge pull request #16844 from FRRouting/mergify/bp/stable/9.1/pr-16809
Donald Sharp [Tue, 17 Sep 2024 17:42:16 +0000 (13:42 -0400)]
Merge pull request #16844 from FRRouting/mergify/bp/stable/9.1/pr-16809

isisd: fix rcap tlv double-free crash (backport #16809)

7 months agotests: update isisd fuzz test 16844/head
Louis Scalbert [Mon, 16 Sep 2024 11:43:26 +0000 (13:43 +0200)]
tests: update isisd fuzz test

Since the previous commit, if a router capability subTLV is not
readable, the previously read subTLVs are kept.

Update of the ISIS fuzz test.

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

> $ ./test_fuzz_isis_tlv 2>/dev/null | grep failed
> Test 139 failed, output differs.
> Test 150 failed, output differs.
> 2 of 405 tests failed.
>
> $ ./test_fuzz_isis_tlv 139 2>/dev/null
> Test 139 failed, output differs.
> Expected output:
> Unpack log:
> Unpacking 564 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 193 and len 13.
>     Skipping unknown TLV 193 (13 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Received output:
> Unpack log:
> Unpacking 564 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 193 and len 13.
>     Skipping unknown TLV 193 (13 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Router Capability: 253.212.128.242 , D:1, S:1
>
> $ ./test_fuzz_isis_tlv 150 2>/dev/null
> Test 150 failed, output differs.
> Expected output:
> Unpack log:
> Unpacking 403 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 129 and len 13.
>     Unpacking Protocols Supported TLV...
>       Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
>   Unpacking TLV...
>     Found TLV of type 11 and len 11.
>     Skipping unknown TLV 11 (11 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
> Received output:
> Unpack log:
> Unpacking 403 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 129 and len 13.
>     Unpacking Protocols Supported TLV...
>       Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
>   Unpacking TLV...
>     Found TLV of type 11 and len 11.
>     Skipping unknown TLV 11 (11 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
> Router Capability: 253.212.128.242 , D:1, S:1

Link: https://pypi.org/project/wuschl/
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit cfd050a0e5a636efae93865d982714da9dbf06a6)

7 months agoisisd: fix rcap tlv double-free crash
Louis Scalbert [Thu, 12 Sep 2024 07:31:49 +0000 (09:31 +0200)]
isisd: fix rcap tlv double-free crash

A double-free crash happens when a subTLV of the "Router Capability"
TLV is not readable and a previous "Router Capability" TLV was read.

rcap was supposed to be freed later by isis_free_tlvs() ->
free_tlv_router_cap(). In 78774bbcd5 ("isisd: add isis flex-algo lsp
advertisement"), this was not the case because rcap was not saved to
tlvs->router_cap when the function returned early because of a subTLV
length issue.

Always set tlvs->router_cap to free the memory.

Note that this patch has the consequence that in case of subTLV error,
the previously read "Router Capability" subTLVs are kept in memory.

Fixes: 49efc80d34 ("isisd: Ensure rcap is freed in error case")
Fixes: 78774bbcd5 ("isisd: add isis flex-algo lsp advertisement")
Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit d61758140d33972c10ecbb72d0a3e528049dd8d6)

7 months agoMerge pull request #16825 from FRRouting/mergify/bp/stable/9.1/pr-16818
Donald Sharp [Fri, 13 Sep 2024 23:52:17 +0000 (19:52 -0400)]
Merge pull request #16825 from FRRouting/mergify/bp/stable/9.1/pr-16818

ospfd: missing '[no]ip ospf graceful-restart hello-delay <N>' commands (backport #16818)

7 months agoospfd: fix missing '[no]ip ospf graceful-restart hello-delay <N>' commands 16825/head
Dmitrii Turlupov [Fri, 13 Sep 2024 13:22:18 +0000 (16:22 +0300)]
ospfd: fix missing '[no]ip ospf graceful-restart hello-delay <N>' commands

Signed-off-by: Dmitrii Turlupov <turlupov@bk.ru>
(cherry picked from commit 69e31a547f8520fd967cc34dc0cd3a8f915d07f8)

7 months agoMerge pull request #16821 from FRRouting/mergify/bp/stable/9.1/pr-16808
Jafar Al-Gharaibeh [Fri, 13 Sep 2024 18:11:33 +0000 (14:11 -0400)]
Merge pull request #16821 from FRRouting/mergify/bp/stable/9.1/pr-16808

nhrpd: fixes duplicate auth extension (backport #16808)

7 months agonhrpd: fixes duplicate auth extension 16821/head
Denys Haryachyy [Thu, 12 Sep 2024 07:28:28 +0000 (07:28 +0000)]
nhrpd: fixes duplicate auth extension

When an NHRP peer was forwarding a message, it was copying all
extensions from the originally received packet. The authentication
extension must be regenerated hop by hop per RFC2332.
This fix checks for the auth extension when copying extensions
and omits the original packet auth and instead regenerates a new auth extension.

Fix bug #16507

Signed-off-by: Denys Haryachyy <garyachy@gmail.com>
(cherry picked from commit 8e3c278bbcd0ced1d4058cc7a2c9aebdfbc8b651)

7 months agoMerge pull request #16804 from opensourcerouting/fix/backport_ABUILD_APK_INDEX_OPTS_9.1
Donald Sharp [Thu, 12 Sep 2024 12:22:32 +0000 (08:22 -0400)]
Merge pull request #16804 from opensourcerouting/fix/backport_ABUILD_APK_INDEX_OPTS_9.1

9.1 Backport docker ABUILD_APK_INDEX_OPTS