]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
5 weeks agoMerge pull request #18491 from opensourcerouting/fix/backport_9a26a56c5188fd1c95e2449...
Donald Sharp [Tue, 25 Mar 2025 13:01:53 +0000 (09:01 -0400)]
Merge pull request #18491 from opensourcerouting/fix/backport_9a26a56c5188fd1c95e244932bc17f97b9051935_10.0

bgpd: Fix holdtime not working properly when busy

5 weeks agobgpd: Fix holdtime not working properly when busy 18491/head
Donald Sharp [Mon, 24 Mar 2025 18:28:38 +0000 (14:28 -0400)]
bgpd: Fix holdtime not working properly when busy

Commit:  cc9f21da2218d95567eff1501482ce58e6600f54

Modified the bgp_fsm code to dissallow the extension
of the hold time when the system is under extremely
heavy load.  This was a attempt to remove the return
code but it was too aggressive and messed up this bit
of code.

Put the behavior back that was introduced in:
d0874d195d0127009a7d9c06920c52c95319eff9

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 weeks agoMerge pull request #18466 from opensourcerouting/fix/backport_4ee47bfc83e1977458a6049...
Donald Sharp [Sun, 23 Mar 2025 19:18:33 +0000 (15:18 -0400)]
Merge pull request #18466 from opensourcerouting/fix/backport_4ee47bfc83e1977458a6049c653019d6b7576320_10.0

bgpd: fix `set evpn gateway-ip ipv[46]` route-map

5 weeks agobgpd: fix `set evpn gateway-ip ipv[46]` route-map 18466/head
Tuetuopay [Fri, 14 Mar 2025 19:21:46 +0000 (20:21 +0100)]
bgpd: fix `set evpn gateway-ip ipv[46]` route-map

The `route_set_evpn_gateway_ip` function copies `gw_ip->ip.addr` in the
route's gateway ip. In a nutshell, this skips the `ipa_type` field,
writing the actual IP in the IP type. This later rightfully trips
asserts about unknown IP types.

The following route-map...

```
route-map test permit 10
    set evpn gateway-ip ipv4 1.1.1.1
```

...will make the following gateway IP in the route:

```
(gdb) p/x a1->evpn_overlay->gw_ip
$11 = {ipa_type = 0x1010101, ip = {addr = 0x0, addrbytes = {
      0x0 <repeats 16 times>}, _v4_addr = {s_addr = 0x0}, _v6_addr = {
      __in6_u = {__u6_addr8 = {0x0 <repeats 16 times>}, __u6_addr16 = {0x0,
          0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, __u6_addr32 = {0x0, 0x0, 0x0,
          0x0}}}}}
```

We do indeed see the IP Address in the `ipa_type` field.

Fix by starting the memcpy at the root of `struct ipaddr` instead of
skipping the `ipa_type` field.

Fixes: d0a4ee6010a ("bgpd: Add "set evpn gateway-ip" clause for route-map")
Signed-off-by: Tuetuopay <tuetuopay@me.com>
(cherry picked from commit 0b0e7015971a788c14dd1dc9b5bac8cb66175c29)

5 weeks agoMerge pull request #18458 from FRRouting/mergify/bp/stable/10.0/pr-18108
Donald Sharp [Sat, 22 Mar 2025 19:25:35 +0000 (15:25 -0400)]
Merge pull request #18458 from FRRouting/mergify/bp/stable/10.0/pr-18108

zebra: Do not flush an existing vni configuration trying to remove wrong vni (backport #18108)

5 weeks agozebra: Do not flush an existing vni configuration trying to remove wrong vni mergify/bp/stable/10.0/pr-18108 18458/head
Donatas Abraitis [Tue, 11 Feb 2025 19:22:12 +0000 (21:22 +0200)]
zebra: Do not flush an existing vni configuration trying to remove wrong vni

Before:

```
pc.donatas.net(config)# do sh run | include vni
vni 1
pc.donatas.net(config)# no vni 2
pc.donatas.net(config)# do sh run | include vni
pc.donatas.net(config)#
```

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

5 weeks agoMerge pull request #18425 from FRRouting/mergify/bp/stable/10.0/pr-18393
Donald Sharp [Thu, 20 Mar 2025 00:44:07 +0000 (20:44 -0400)]
Merge pull request #18425 from FRRouting/mergify/bp/stable/10.0/pr-18393

ospf6d: Disable and delete OSPFv3 areas that no longer have interfaces or configuration. (backport #18393)

5 weeks ago ospf6d: Disable and delete OSPFv3 areas that no longer have interfaces or configur... 18425/head
Acee Lindem [Fri, 14 Mar 2025 16:02:28 +0000 (16:02 +0000)]
   ospf6d: Disable and delete OSPFv3 areas that no longer have interfaces or configuration.

        This fix will delete an OSPFv3 area when all the interfaces and
        configuration (ranges, NSSA ranges, stub area, NSSA area, filter-list,
        import-list and export-list) have been removed. The changes provides
        a general solution to https://github.com/FRRouting/frr/issues/18324.

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

6 weeks agoMerge pull request #18405 from FRRouting/mergify/bp/stable/10.0/pr-18387
Donald Sharp [Mon, 17 Mar 2025 12:15:16 +0000 (08:15 -0400)]
Merge pull request #18405 from FRRouting/mergify/bp/stable/10.0/pr-18387

bgpd: Fixed crash upon bgp network import-check command (backport #18387)

6 weeks agobgpd: Fixed crash upon bgp network import-check command 18405/head
Manpreet Kaur [Thu, 13 Mar 2025 11:14:24 +0000 (04:14 -0700)]
bgpd: Fixed crash upon bgp network import-check command

BT:
```
3  <signal handler called>
4  0x00005616837546fc in bgp_static_update (bgp=bgp@entry=0x5616865eac50, p=0x561686639e40,
    bgp_static=0x561686639f50, afi=afi@entry=AFI_IP6, safi=safi@entry=SAFI_UNICAST) at ../bgpd/bgp_route.c:7232
5  0x0000561683754ad0 in bgp_static_add (bgp=0x5616865eac50) at ../bgpd/bgp_table.h:413
6  0x0000561683785e2e in no_bgp_network_import_check (self=<optimized out>, vty=0x5616865e04c0,
    argc=<optimized out>, argv=<optimized out>) at ../bgpd/bgp_vty.c:4609
7  0x00007fdbcc294820 in cmd_execute_command_real (vline=vline@entry=0x561686663000,
```

The program encountered a SEG FAULT when attempting to access pi->extra->vrfleak->bgp_orig because
pi->extra->vrfleak was NULL.
```
(gdb) p pi->extra->vrfleak
$1 = (struct bgp_path_info_extra_vrfleak *) 0x0
(gdb) p pi->extra->vrfleak->bgp_orig
Cannot access memory at address 0x8
```
Added NOT NULL check on pi->extra->vrfleak before accessing pi->extra->vrfleak->bgp_orig
to prevent the segmentation fault.

Signed-off-by: Manpreet Kaur <manpreetk@nvidia.com>
(cherry picked from commit bc1008b970541c090e36fc1d50c720df822fcb99)

8 weeks agoMerge pull request #18297 from FRRouting/mergify/bp/stable/10.0/pr-18294
Donald Sharp [Mon, 3 Mar 2025 15:34:44 +0000 (10:34 -0500)]
Merge pull request #18297 from FRRouting/mergify/bp/stable/10.0/pr-18294

isisd: Correct edge insertion into TED (backport #18294)

8 weeks agoisisd: Correct edge insertion into TED 18297/head
Olivier Dugeon [Mon, 3 Mar 2025 09:08:17 +0000 (10:08 +0100)]
isisd: Correct edge insertion into TED

Edges are not correctly linked to Vertices during LSP processing. In function
lsp_to_edge_cb(), once edge created or updated from the LSP TLVs, the code try
to link the edge to destination vertices. In case the revert edge is not found,
the code try to found a destination vertex to link to. But, the sys_id used
for this operation corresponds to the source vertex. As a result, the edge is
attached as source and destination of the vertex. When Traffic Engineering is
stopped, TED is deleted which result into a double free of the edge attributes.
This cause a crash when attempt to free extended admin groupi the second time.

This patch removed wrong code which link twice the edge to the source vertex.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
(cherry picked from commit 605fc1dd6404b6ed51691c647568939adde4962a)

2 months agoMerge pull request #18199 from FRRouting/revert-18157-mergify/bp/stable/10.0/pr-18121
Jafar Al-Gharaibeh [Wed, 19 Feb 2025 19:07:50 +0000 (13:07 -0600)]
Merge pull request #18199 from FRRouting/revert-18157-mergify/bp/stable/10.0/pr-18121

Revert "bgpd: release manual vpn label on instance deletion (backport #18121)"

2 months agoRevert "bgpd: release manual vpn label on instance deletion (backport #18121)" 18199/head
Donald Sharp [Wed, 19 Feb 2025 15:52:38 +0000 (10:52 -0500)]
Revert "bgpd: release manual vpn label on instance deletion (backport #18121)"

2 months agoMerge pull request #18157 from FRRouting/mergify/bp/stable/10.0/pr-18121
Russ White [Tue, 18 Feb 2025 15:27:46 +0000 (10:27 -0500)]
Merge pull request #18157 from FRRouting/mergify/bp/stable/10.0/pr-18121

bgpd: release manual vpn label on instance deletion (backport #18121)

2 months agoMerge pull request #18186 from FRRouting/mergify/bp/stable/10.0/pr-18109
Donald Sharp [Sun, 16 Feb 2025 13:09:34 +0000 (08:09 -0500)]
Merge pull request #18186 from FRRouting/mergify/bp/stable/10.0/pr-18109

bgpd: fix vty output of evpn route-target AS4 (backport #18109)

2 months agobgpd: fix vty output of evpn route-target AS4 18186/head
Mark Stapp [Tue, 11 Feb 2025 19:35:28 +0000 (14:35 -0500)]
bgpd: fix vty output of evpn route-target AS4

evpn route-targets are decoded in  ... multiple places; at least
two have a bug where the AS4 form doesn't have its AS decoded.

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

2 months agoMerge pull request #18174 from cscarpitta/fix/backport_srv6_route_dump_for_10.0
Donald Sharp [Sat, 15 Feb 2025 14:16:29 +0000 (09:16 -0500)]
Merge pull request #18174 from cscarpitta/fix/backport_srv6_route_dump_for_10.0

lib: fix false context information for SRv6 route (backport #18023 for 10.0)

2 months agoMerge pull request #18169 from FRRouting/mergify/bp/stable/10.0/pr-18160
Donald Sharp [Sat, 15 Feb 2025 14:15:05 +0000 (09:15 -0500)]
Merge pull request #18169 from FRRouting/mergify/bp/stable/10.0/pr-18160

bgpd: When removing the prefix list drop the pointer (backport #18160)

2 months agolib: fix false context information for SRv6 route 18174/head
Philippe Guibert [Wed, 5 Feb 2025 08:52:59 +0000 (09:52 +0100)]
lib: fix false context information for SRv6 route

The seg6local route dumped by 'show ipv6 route' makes think that the USP
flavor is supported, whereas it is not the case. This information is a
context information, and for End, the context information should be
empty.

> # show ipv6 route
> [..]
> I>* fc00:0:4::/128 [115/0] is directly connected, sr0, seg6local End USP, weight 1, 00:49:01

Fix this by suppressing the USP information from the output.

Fixes: e496b4203055 ("bgpd: prefix-sid srv6 l3vpn service tlv")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agobgpd: When removing the prefix list drop the pointer 18169/head
Donald Sharp [Fri, 14 Feb 2025 12:55:09 +0000 (07:55 -0500)]
bgpd: When removing the prefix list drop the pointer

We are very very rarely seeing this crash:

    0 0x7f36ba48e389 in prefix_list_apply_ext lib/plist.c:789
    1 0x55eff3fa4126 in subgroup_announce_check bgpd/bgp_route.c:2334
    2 0x55eff3fa858e in subgroup_process_announce_selected bgpd/bgp_route.c:3440
    3 0x55eff4016488 in subgroup_announce_table bgpd/bgp_updgrp_adv.c:808
    4 0x55eff401664e in subgroup_announce_route bgpd/bgp_updgrp_adv.c:861
    5 0x55eff40111df in peer_af_announce_route bgpd/bgp_updgrp.c:2223
    6 0x55eff3f884cb in bgp_announce_route_timer_expired bgpd/bgp_route.c:5892
    7 0x7f36ba4ec239 in event_call lib/event.c:2019
    8 0x7f36ba41a22a in frr_run lib/libfrr.c:1295
    9 0x55eff3e668b7 in main bgpd/bgp_main.c:557
    10 0x7f36b9e2d249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    11 0x7f36b9e2d304 in __libc_start_main_impl ../csu/libc-start.c:360
    12 0x55eff3e64a30 in _start (/home/ci/cibuild.1407/frr-source/bgpd/.libs/bgpd+0x2fda30)
0x608000037038 is located 24 bytes inside of 88-byte region [0x608000037020,0x608000037078)
freed by thread T0 here:
    0 0x7f36ba8b76a8 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52
    1 0x7f36ba439bd7 in qfree lib/memory.c:131
    2 0x7f36ba48d3a3 in prefix_list_free lib/plist.c:156
    3 0x7f36ba48d3a3 in prefix_list_delete lib/plist.c:247
    4 0x7f36ba48fbef in prefix_bgp_orf_remove_all lib/plist.c:1516
    5 0x55eff3f679c4 in bgp_route_refresh_receive bgpd/bgp_packet.c:2841
    6 0x55eff3f70bab in bgp_process_packet bgpd/bgp_packet.c:4069
    7 0x7f36ba4ec239 in event_call lib/event.c:2019
    8 0x7f36ba41a22a in frr_run lib/libfrr.c:1295
    9 0x55eff3e668b7 in main bgpd/bgp_main.c:557
    10 0x7f36b9e2d249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
previously allocated by thread T0 here:
    0 0x7f36ba8b83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    1 0x7f36ba4392e4 in qcalloc lib/memory.c:106
    2 0x7f36ba48d0de in prefix_list_new lib/plist.c:150
    3 0x7f36ba48d0de in prefix_list_insert lib/plist.c:186
    4 0x7f36ba48d0de in prefix_list_get lib/plist.c:204
    5 0x7f36ba48f9df in prefix_bgp_orf_set lib/plist.c:1479
    6 0x55eff3f67ba6 in bgp_route_refresh_receive bgpd/bgp_packet.c:2920
    7 0x55eff3f70bab in bgp_process_packet bgpd/bgp_packet.c:4069
    8 0x7f36ba4ec239 in event_call lib/event.c:2019
    9 0x7f36ba41a22a in frr_run lib/libfrr.c:1295
    10 0x55eff3e668b7 in main bgpd/bgp_main.c:557
    11 0x7f36b9e2d249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Let's just stop trying to save the pointer around in the peer->orf_plist
data structure.  There are other design problems but at least lets
stop the crash from possibly happening.

Fixes: #18138
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 3d43d7b78971520854903c11b6aec23754fdca34)

2 months agoMerge pull request #18153 from opensourcerouting/fix/backport_bgp_bfd_10.0
Donald Sharp [Fri, 14 Feb 2025 01:22:38 +0000 (20:22 -0500)]
Merge pull request #18153 from opensourcerouting/fix/backport_bgp_bfd_10.0

bgp/bfd backports for stable/10.0

2 months agobgpd: release manual vpn label on instance deletion 18157/head
Louis Scalbert [Wed, 12 Feb 2025 12:49:50 +0000 (13:49 +0100)]
bgpd: release manual vpn label on instance deletion

When a BGP instance with a manually assigned VPN label is deleted, the
label is not released from the Zebra label registry. As a result,
reapplying a configuration with the same manual label leads to VPN
prefix export failures.

For example, with the following configuration:

> router bgp 65000 vrf BLUE
>  address-family ipv4 unicast
>   label vpn export <int>

Release zebra label registry on unconfiguration.

Fixes: d162d5f6f5 ("bgpd: fix hardset l3vpn label available in mpls pool")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit d6363625c35a99933bf60c9cf0b79627b468c9f7)

# Conflicts:
# bgpd/bgpd.c

2 months agobgpd: fix bfd with update-source in peer-group 18153/head
Louis Scalbert [Wed, 22 Jan 2025 12:30:55 +0000 (13:30 +0100)]
bgpd: fix bfd with update-source in peer-group

Fix BFD session not created when the peer is in update-group with the
update-source option.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agobgpd: When bgp notices a change to shared_network inform bfd of it
Donald Sharp [Thu, 5 Dec 2024 15:16:03 +0000 (10:16 -0500)]
bgpd: When bgp notices a change to shared_network inform bfd of it

When bgp is started up and reads the config in *before* it has
received interface addresses from zebra, shared_network can
be set to false in this case.  Later on once bgp attempts to
reconnect it will refigure out the shared_network again( because
it has received the data from zebra now ).  In this case
tell bfd about it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agobgpd: Allow bfd to work if peer known but interface address not yet
Donald Sharp [Wed, 20 Nov 2024 21:07:34 +0000 (16:07 -0500)]
bgpd: Allow bfd to work if peer known but interface address not yet

If bgp is coming up and bgp has not received the interface address yet
but bgp has knowledge about a bfd peering, allow it to set the peering
data appropriately.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agobgpd: Update source address for BFD session
Donatas Abraitis [Tue, 12 Nov 2024 11:09:09 +0000 (13:09 +0200)]
bgpd: Update source address for BFD session

If BFD is down, we should try to detect the source automatically from the given
interface.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 months agobgpd: Reset BGP session only if it was a real BFD DOWN event
Donatas Abraitis [Tue, 5 Nov 2024 13:51:58 +0000 (15:51 +0200)]
bgpd: Reset BGP session only if it was a real BFD DOWN event

Without this patch we always see a double-reset, e.g.:

```
2024/11/04 12:42:43.010 BGP: [VQY9X-CQZKG] bgp_peer_bfd_update_source: address [0.0.0.0->172.18.0.3] to [172.18.0.2->172.18.0.3]
2024/11/04 12:42:43.010 BGP: [X8BD9-8RKN4] bgp_peer_bfd_update_source: interface none to eth0
2024/11/04 12:42:43.010 BFD: [MSVDW-Y8Z5Q] ptm-del-dest: deregister peer [mhop:no peer:172.18.0.3 local:0.0.0.0 vrf:default cbit:0x00 minimum-ttl:255]
2024/11/04 12:42:43.010 BFD: [NYF5K-SE3NS] ptm-del-session: [mhop:no peer:172.18.0.3 local:0.0.0.0 vrf:default] refcount=0
2024/11/04 12:42:43.010 BFD: [NW21R-MRYNT] session-delete: mhop:no peer:172.18.0.3 local:0.0.0.0 vrf:default
2024/11/04 12:42:43.010 BGP: [P3D3N-3277A] 172.18.0.3 [FSM] Timer (routeadv timer expire)
2024/11/04 12:42:43.010 BFD: [YA0Q5-C0BPV] control-packet: no session found [mhop:no peer:172.18.0.3 local:172.18.0.2 port:11]
2024/11/04 12:42:43.010 BFD: [MSVDW-Y8Z5Q] ptm-add-dest: register peer [mhop:no peer:172.18.0.3 local:172.18.0.2 vrf:default cbit:0x00 minimum-ttl:255]
2024/11/04 12:42:43.011 BFD: [PSB4R-8T1TJ] session-new: mhop:no peer:172.18.0.3 local:172.18.0.2 vrf:default ifname:eth0
2024/11/04 12:42:43.011 BGP: [Q4BCV-6FHZ5] zclient_bfd_session_update: 172.18.0.2/32 -> 172.18.0.3/32 (interface eth0) VRF default(0) (CPI bit no): Down
2024/11/04 12:42:43.011 BGP: [MKVHZ-7MS3V] bfd_session_status_update: neighbor 172.18.0.3 vrf default(0) bfd state Up -> Down
2024/11/04 12:42:43.011 BGP: [HZN6M-XRM1G] %NOTIFICATION: sent to neighbor 172.18.0.3 6/10 (Cease/BFD Down) 0 bytes
2024/11/04 12:42:43.011 BGP: [QFMSE-NPSNN] zclient_bfd_session_update:   sessions updated: 1
2024/11/04 12:42:43.011 BGP: [ZWCSR-M7FG9] 172.18.0.3 [FSM] BGP_Stop (Established->Clearing), fd 22
```

Reset is due to the source address change.

With this patch, we reset the session only if it's a _REAL_ BFD down event, which
means we trigger session reset if BFD session is established earlier than BGP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 months agoMerge pull request #18136 from FRRouting/mergify/bp/stable/10.0/pr-18120
Donald Sharp [Thu, 13 Feb 2025 16:18:46 +0000 (11:18 -0500)]
Merge pull request #18136 from FRRouting/mergify/bp/stable/10.0/pr-18120

bgpd: fix incorrect JSON in bgp_show_table_rd (backport #18120)

2 months agobgpd: fix incorrect json in bgp_show_table_rd 18136/head
Louis Scalbert [Wed, 12 Feb 2025 11:50:42 +0000 (12:50 +0100)]
bgpd: fix incorrect json in bgp_show_table_rd

In bgp_show_table_rd(), the is_last argument is determined using the
expression "next == NULL" to check if the RD table is the last one. This
helps ensure proper JSON formatting.

However, if next is not NULL but is no longer associated with a BGP
table, the JSON output becomes malformed.

Updates the condition to also verify the existence of the next bgp_dest
table.

Fixes: 1ae44dfcba ("bgpd: unify 'show bgp' with RD with normal unicast bgp show")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit cf0269649cdd09b8d3f2dd8815caf6ecf9cdeef9)

2 months agoMerge pull request #18091 from FRRouting/mergify/bp/stable/10.0/pr-17935
Donald Sharp [Wed, 12 Feb 2025 13:19:11 +0000 (08:19 -0500)]
Merge pull request #18091 from FRRouting/mergify/bp/stable/10.0/pr-17935

zebra: include resolving nexthops in nhg hash (backport #17935)

2 months agoMerge pull request #18104 from FRRouting/mergify/bp/stable/10.0/pr-18060
Jafar Al-Gharaibeh [Wed, 12 Feb 2025 02:53:07 +0000 (20:53 -0600)]
Merge pull request #18104 from FRRouting/mergify/bp/stable/10.0/pr-18060

lib: crash handlers must be allowed on threads (backport #18060)

2 months agoMerge pull request #18086 from FRRouting/mergify/bp/stable/10.0/pr-17901
Jafar Al-Gharaibeh [Tue, 11 Feb 2025 18:22:34 +0000 (12:22 -0600)]
Merge pull request #18086 from FRRouting/mergify/bp/stable/10.0/pr-17901

lib: actually hash all 16 bytes of IPv6 addresses, not just 4 (backport #17901)

2 months agolib: crash handlers must be allowed on threads 18104/head
David Lamparter [Fri, 7 Feb 2025 12:22:25 +0000 (13:22 +0100)]
lib: crash handlers must be allowed on threads

Blocking all signals on non-main threads is not the way to go, at least
the handlers for SIGSEGV, SIGBUS, SIGILL, SIGABRT and SIGFPE need to run
so we get backtraces.  Otherwise the process just exits.

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

2 months agolib: clean up nexthop hashing mess 18086/head
David Lamparter [Wed, 22 Jan 2025 10:23:31 +0000 (11:23 +0100)]
lib: clean up nexthop hashing mess

We were hashing 4 bytes of the address.  Even for IPv6 addresses.

Oops.

The reason this was done was to try to make it faster, but made a
complex maze out of everything.  Time for a refactor.

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

2 months agolib: guard against padding garbage in ZAPI read
David Lamparter [Wed, 22 Jan 2025 10:19:04 +0000 (11:19 +0100)]
lib: guard against padding garbage in ZAPI read

When reading in a nexthop from ZAPI, only set the fields that actually
have meaning.  While it shouldn't happen to begin with, we can otherwise
carry padding garbage into the unused leftover union bytes.

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

2 months agozebra: guard against junk in nexthop->rmap_src
David Lamparter [Wed, 22 Jan 2025 10:17:21 +0000 (11:17 +0100)]
zebra: guard against junk in nexthop->rmap_src

rmap_src wasn't initialized, so for IPv4 the unused 12 bytes would
contain whatever junk is on the stack on function entry.  Also move
the IPv4 parse before the IPv6 parse so if it's successful we can be
sure the other bytes haven't been touched.

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

2 months agopbrd: initialize structs used in hash_lookup
David Lamparter [Wed, 22 Jan 2025 10:16:10 +0000 (11:16 +0100)]
pbrd: initialize structs used in hash_lookup

Doesn't seem to break anything but really poor style to pass potentially
uninitialized data to hash_lookup.

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

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)

2 months agotests: Add a test that shows the v6 recursive nexthop problem 18091/head
Donald Sharp [Mon, 27 Jan 2025 15:34:31 +0000 (10:34 -0500)]
tests: Add a test that shows the v6 recursive nexthop problem

Currently FRR does not handle v6 recurisive resolution properly
when the route being recursed through changes and the most
significant bits of the route are not changed.

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

2 months agozebra: include resolving nexthops in nhg hash
Mark Stapp [Mon, 27 Jan 2025 19:17:24 +0000 (14:17 -0500)]
zebra: include resolving nexthops in nhg hash

Ensure that the nhg hash comparison function includes all
nexthops, including recursive-resolving nexthops.

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

2 months agoMerge pull request #18017 from opensourcerouting/fix/backport_739f2b566a8217acce84d4c...
Russ White [Wed, 5 Feb 2025 13:33:35 +0000 (08:33 -0500)]
Merge pull request #18017 from opensourcerouting/fix/backport_739f2b566a8217acce84d4c21aaf033314f535bb_10.0

bgpd: Do not start BGP session if BGP identifier is not set (backport)

2 months agobgpd: Do not start BGP session if BGP identifier is not set 18017/head
Donatas Abraitis [Wed, 29 Jan 2025 21:03:06 +0000 (23:03 +0200)]
bgpd: Do not start BGP session if BGP identifier is not set

If we have IPv6-only network and no IPv4 addresses at all, then by default
0.0.0.0 is created which is treated as malformed according to RFC 6286.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 months agoMerge pull request #18024 from opensourcerouting/fix/revert_a73b0f88c7715bfcf5dc8ffd4...
Mark Stapp [Wed, 5 Feb 2025 12:52:51 +0000 (07:52 -0500)]
Merge pull request #18024 from opensourcerouting/fix/revert_a73b0f88c7715bfcf5dc8ffd46d2fd0bbc9a8aff

Fix 10.0 branch

2 months agoRevert "tests: Check if OAD peers can exchange non-transitive extended communities" 18024/head
Donatas Abraitis [Wed, 5 Feb 2025 09:49:16 +0000 (11:49 +0200)]
Revert "tests: Check if OAD peers can exchange non-transitive extended communities"

This reverts commit fa438172d868b0da4c99cd972356dc8ed9f1f016.

2 months agoRevert "bgpd: Send non-transitive extended communities from/to OAD peers"
Donatas Abraitis [Wed, 5 Feb 2025 09:47:04 +0000 (11:47 +0200)]
Revert "bgpd: Send non-transitive extended communities from/to OAD peers"

This reverts commit a73b0f88c7715bfcf5dc8ffd46d2fd0bbc9a8aff.

2 months agoMerge pull request #18012 from FRRouting/mergify/bp/stable/10.0/pr-17896
Russ White [Tue, 4 Feb 2025 16:45:36 +0000 (11:45 -0500)]
Merge pull request #18012 from FRRouting/mergify/bp/stable/10.0/pr-17896

bgpd: Send non-transitive extended communities from/to OAD peers (backport #17896)

2 months agotests: Check if OAD peers can exchange non-transitive extended communities 18012/head
Donatas Abraitis [Tue, 21 Jan 2025 19:25:14 +0000 (21:25 +0200)]
tests: Check if OAD peers can exchange non-transitive extended communities

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

2 months agobgpd: Send non-transitive extended communities from/to OAD peers
Donatas Abraitis [Tue, 21 Jan 2025 19:17:39 +0000 (21:17 +0200)]
bgpd: Send non-transitive extended communities from/to OAD peers

draft-uttaro-idr-bgp-oad says:

Extended communities which are non-transitive across an AS boundary MAY be
advertised over an EBGP-OAD session if allowed by explicit policy configuration.
If allowed, all the members of the OAD SHOULD be configured to use the same
criteria.
For example, the Origin Validation State Extended Community, defined as
non-transitive in [RFC8097], can be advertised to peers in the same OAD.

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

# Conflicts:
# bgpd/bgp_route.c

2 months agoMerge pull request #17996 from FRRouting/mergify/bp/stable/10.0/pr-17991
Russ White [Tue, 4 Feb 2025 16:16:20 +0000 (11:16 -0500)]
Merge pull request #17996 from FRRouting/mergify/bp/stable/10.0/pr-17991

zebra: fix evpn svd hash avoid double free (backport #17991)

2 months agoMerge pull request #17999 from FRRouting/mergify/bp/stable/10.0/pr-17992
Jafar Al-Gharaibeh [Tue, 4 Feb 2025 16:15:16 +0000 (10:15 -0600)]
Merge pull request #17999 from FRRouting/mergify/bp/stable/10.0/pr-17992

bgpd: fix route-distinguisher in vrf leak json cmd (backport #17992)

2 months agobgpd: fix route-distinguisher in vrf leak json cmd 17999/head
Chirag Shah [Mon, 3 Feb 2025 20:00:41 +0000 (12:00 -0800)]
bgpd: fix route-distinguisher in vrf leak json cmd

For auto configured value RD value comes as NULL,
switching back to original change will ensure to cover
for both auto and user configured RD value in JSON.

tor-11# show bgp vrf blue ipv4 unicast route-leak json
{
  "vrf":"blue",
  "afiSafi":"ipv4Unicast",
  "importFromVrfs":[
    "purple"
  ],
  "importRts":"10.10.3.11:6",
  "exportToVrfs":[
    "purple"
  ],
  "routeDistinguisher":"(null)", <<<<<
  "exportRts":"10.10.3.11:10"
}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 892704d07f5286464728720648ad392b485a9966)

2 months agozebra: evpn svd hash avoid double free 17996/head
Chirag Shah [Fri, 31 Jan 2025 01:26:46 +0000 (17:26 -0800)]
zebra: evpn svd hash avoid double free

Upon zebra shutdown hash_clean_and_free is called
where user free function is passed,
The free function should not call hash_release
which lead to double free of hash bucket.

Fix:
The fix is to avoid calling hash_release from
free function if its called from hash_clean_and_free
path.

10 0x00007f0422b7df1f in free () from /lib/x86_64-linux-gnu/libc.so.6
11 0x00007f0422edd779 in qfree (mt=0x7f0423047ca0 <MTYPE_HASH_BUCKET>,
    ptr=0x55fc8bc81980) at ../lib/memory.c:130
12 0x00007f0422eb97e2 in hash_clean (hash=0x55fc8b979a60,
    free_func=0x55fc8a529478 <svd_nh_del_terminate>) at
    ../lib/hash.c:290
13 0x00007f0422eb98a1 in hash_clean_and_free (hash=0x55fc8a675920
    <svd_nh_table>, free_func=0x55fc8a529478 <svd_nh_del_terminate>) at
    ../lib/hash.c:305
14 0x000055fc8a5323a5 in zebra_vxlan_terminate () at
    ../zebra/zebra_vxlan.c:6099
15 0x000055fc8a4c9227 in zebra_router_terminate () at
    ../zebra/zebra_router.c:276
16 0x000055fc8a4413b3 in zebra_finalize (dummy=0x7fffb881c1d0) at
    ../zebra/main.c:269
17 0x00007f0422f44387 in event_call (thread=0x7fffb881c1d0) at
    ../lib/event.c:2011
18 0x00007f0422ecb6fa in frr_run (master=0x55fc8b733cb0) at
    ../lib/libfrr.c:1243
19 0x000055fc8a441987 in main (argc=14, argv=0x7fffb881c4a8) at
    ../zebra/main.c:584

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 1d4f5b9b19588d77d3eaf06440c26a8c974831a3)

2 months agoMerge pull request #17973 from FRRouting/mergify/bp/stable/10.0/pr-17971
Donatas Abraitis [Sun, 2 Feb 2025 07:52:09 +0000 (09:52 +0200)]
Merge pull request #17973 from FRRouting/mergify/bp/stable/10.0/pr-17971

bgpd: With suppress-fib-pending ensure withdrawal is sent (backport #17971)

2 months agobgpd: With suppress-fib-pending ensure withdrawal is sent 17973/head
Donald Sharp [Fri, 31 Jan 2025 23:53:30 +0000 (18:53 -0500)]
bgpd: With suppress-fib-pending ensure withdrawal is sent

When you have suppress-fib-pending turned on it is possible
to end up in a situation where the prefix is not withdrawn
from downstream peers.

Here is the timing that I believe is happening:

a) have 2 paths to a peer.
b) receive a withdrawal from 1 path, set BGP_NODE_FIB_INSTALL_PENDING
   and send the route install to zebra.
c) receive a withdrawal from the other path.
d) At this point we have a dest->flags set BGP_NODE_FIB_INSTALL_PENDING
   old_select the path_info going away, new_select is NULL
e) A bit further down we call group_announce_route() which calls
   the code to see if we should advertise the path.  It sees the
   BGP_NODE_FIB_INSTALL_PENDING flag and says, nope.
f) the route is sent to zebra to withdraw, which unsets the
   BGP_NODE_FIB_INSTALL_PENDING.
g) This function winds up and deletes the path_info.  Dest now
   has no path infos.
h) BGP receives the route install(from step b) and unsets the
   BGP_NODE_FIB_INSTALL_PENDING flag
i) BGP receives the route removed from zebra (from step f) and
   unsets the flag again.

We know if there is no new_select, let's go ahead and just
unset the PENDING flag to allow the withdrawal to go out
at the time when the second withdrawal is received.

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

2 months agoMerge pull request #17951 from FRRouting/mergify/bp/stable/10.0/pr-17946
Donatas Abraitis [Wed, 29 Jan 2025 15:06:27 +0000 (17:06 +0200)]
Merge pull request #17951 from FRRouting/mergify/bp/stable/10.0/pr-17946

tools: Fix frr-reload for ebgp-multihop TTL reconfiguration. (backport #17946)

2 months agotools: Fix frr-reload for ebgp-multihop TTL reconfiguration. 17951/head
Nobuhiro MIKI [Wed, 29 Jan 2025 04:31:53 +0000 (04:31 +0000)]
tools: Fix frr-reload for ebgp-multihop TTL reconfiguration.

In ebgp-multihop, there is a difference in reload behavior when TTL is
unspecified (meaning default 255) and when 255 is explicitly specified.
For example, when reloading with 'neighbor <neighbor> ebgp-multihop
255' in the config, the following difference is created. This commit
fixes that.

    Lines To Delete
    ===============
    router bgp 65001
     no neighbor 10.0.0.4 ebgp-multihop
    exit

    Lines To Add
    ============
    router bgp 65001
     neighbor 10.0.0.4 ebgp-multihop 255
    exit

The commit 767aaa3a8048 is not sufficient and frr-reload needs to be
fixed to handle both unspecified and specified cases.

Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net>
(cherry picked from commit 594e917656da5502b302309aed3cf596df24713f)

3 months agoMerge pull request #17940 from opensourcerouting/fix/revert_4338e21aa2feba57ea7004c36...
Donald Sharp [Tue, 28 Jan 2025 14:35:22 +0000 (09:35 -0500)]
Merge pull request #17940 from opensourcerouting/fix/revert_4338e21aa2feba57ea7004c36362e5d8186340b8_10.0

Revert "bgpd: Handle Addpath capability using dynamic capabilities" (backport)

3 months agoRevert "bgpd: Handle Addpath capability using dynamic capabilities" 17940/head
Donatas Abraitis [Sat, 25 Jan 2025 18:28:26 +0000 (20:28 +0200)]
Revert "bgpd: Handle Addpath capability using dynamic capabilities"

This reverts commit 05cf9d03b345393b8d63ffe9345c42debd8362b6.

TL;DR; Handling BGP AddPath capability is not trivial (possible) dynamically.

When the sender is AddPath-capable and sends NLRIs encoded with AddPath ID,
and at the same time the receiver sends AddPath capability "disable-addpath-rx"
(flag update) via dynamic capabilities, both peers are out of sync about the
AddPath state. The receiver thinks already he's not AddPath-capable anymore,
hence it tries to parse NLRIs as non-AddPath, while they are actually encoded
as AddPath.

AddPath capability itself does not provide (in RFC) any mechanism on backward
compatible way to handle NLRIs if they come mixed (AddPath + non-AddPath).

This explains why we have failures in our CI periodically.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
3 months agoMerge pull request #17893 from FRRouting/mergify/bp/stable/10.0/pr-17888
Donatas Abraitis [Wed, 22 Jan 2025 05:04:43 +0000 (07:04 +0200)]
Merge pull request #17893 from FRRouting/mergify/bp/stable/10.0/pr-17888

bgpd: Fix for local interface MAC cache issue in 'bgp mac hash' table (backport #17888)

3 months agobgpd: Fix for local interface MAC cache issue in 'bgp mac hash' table 17893/head
Krishnasamy R [Tue, 21 Jan 2025 09:06:53 +0000 (01:06 -0800)]
bgpd: Fix for local interface MAC cache issue in 'bgp mac hash' table

Issue:
During FRR restart, we fail to add some of the local interface's MAC
to the 'bgp mac hash'. Not having local MAC in the hash table can cause
lookup issues while receiving EVPN RT-2.

Currently, we have code to add local MAC(bgp_mac_add_mac_entry) while handling
interface add/up events in BGP(bgp_ifp_up/bgp_ifp_create). But the code
'bgp_mac_add_mac_entry' in bgp_ifp_create is not getting invoked as it
is placed under a specific check(vrf->bgp link check).

Fix:
We can skip this check 'vrf->bgp link existence' as the tenant VRF might
not have BGP instance but still we want to cache the tenant VRF local
MACs. So keeping this check in bgp_ifp_create inline with bgp_ifp_up.

Ticket: #4204154

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

3 months agoMerge pull request #17835 from FRRouting/mergify/bp/stable/10.0/pr-17813
Donald Sharp [Fri, 10 Jan 2025 18:35:45 +0000 (13:35 -0500)]
Merge pull request #17835 from FRRouting/mergify/bp/stable/10.0/pr-17813

bgpd: use igpmetric in bgp_aigp_metric_total() (backport #17813)

3 months agobgpd: use igpmetric in bgp_aigp_metric_total() 17835/head
Enke Chen [Thu, 9 Jan 2025 20:02:02 +0000 (12:02 -0800)]
bgpd: use igpmetric in bgp_aigp_metric_total()

Use igpmetric from bgp_path_info in bgp_igp_metric_total() to be
consistent with all other cases, e.g., as in bgp_path_info_cmp().

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

3 months agoMerge pull request #17817 from FRRouting/mergify/bp/stable/10.0/pr-17807
Donatas Abraitis [Fri, 10 Jan 2025 07:43:06 +0000 (09:43 +0200)]
Merge pull request #17817 from FRRouting/mergify/bp/stable/10.0/pr-17807

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

3 months agobgpd: fix crash in displaying json orf prefix-list 17817/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 #17790 from FRRouting/mergify/bp/stable/10.0/pr-17725
Donald Sharp [Tue, 7 Jan 2025 18:08:14 +0000 (13:08 -0500)]
Merge pull request #17790 from FRRouting/mergify/bp/stable/10.0/pr-17725

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

3 months agoMerge pull request #17786 from FRRouting/mergify/bp/stable/10.0/pr-17780
Russ White [Tue, 7 Jan 2025 14:44:48 +0000 (09:44 -0500)]
Merge pull request #17786 from FRRouting/mergify/bp/stable/10.0/pr-17780

bgpd: fix a bug in peer_allowas_in_set() (backport #17780)

3 months agoisisd: Allow full `no` form for `domain-password` and `area-password` 17790/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 agobgpd: fix a bug in peer_allowas_in_set() 17786/head
Enke Chen [Tue, 7 Jan 2025 05:01:14 +0000 (21:01 -0800)]
bgpd: fix a bug in peer_allowas_in_set()

Fix a bug in peer_allowas_in_set() so that the config takes effect
for peer-group members.

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

3 months agoMerge pull request #17765 from FRRouting/mergify/bp/stable/10.0/pr-17750
Jafar Al-Gharaibeh [Sun, 5 Jan 2025 22:06:00 +0000 (16:06 -0600)]
Merge pull request #17765 from FRRouting/mergify/bp/stable/10.0/pr-17750

tools: Add missing rpki keyword to vrf in frr-reload (backport #17750)

3 months agotools: Add missing rpki keyword to vrf in frr-reload 17765/head
Jonathan Voss [Fri, 3 Jan 2025 03:19:30 +0000 (03:19 +0000)]
tools: Add missing rpki keyword to vrf in frr-reload

When reloading the following configuration:
```
vrf red
 rpki
  rpki cache tcp 172.65.0.2 8282 preference 1
 exit
exit-vrf
```
frr-reload.py does not properly enter the `rpki` context
within a `vrf`. Because of this, it fails to apply RPKI
configurations.

Signed-off-by: Jonathan Voss <jvoss@onvox.net>
(cherry picked from commit 975ee8ed6eb22f68538f3446b29ca34d65bec72f)

3 months agoMerge pull request #17757 from FRRouting/mergify/bp/stable/10.0/pr-17732
Mark Stapp [Fri, 3 Jan 2025 15:10:22 +0000 (10:10 -0500)]
Merge pull request #17757 from FRRouting/mergify/bp/stable/10.0/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` 17757/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)

4 months agoFRR Release 10.0.3 rc/10.0.3 docker/10.0.3 frr-10.0.3
Donatas Abraitis [Mon, 23 Dec 2024 21:15:31 +0000 (23:15 +0200)]
FRR Release 10.0.3

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agoMerge pull request #17714 from opensourcerouting/fix/backport_b6dcf618777bb7a11176617...
Jafar Al-Gharaibeh [Mon, 23 Dec 2024 04:49:01 +0000 (22:49 -0600)]
Merge pull request #17714 from opensourcerouting/fix/backport_b6dcf618777bb7a11176617d647e16ab64f49b7b_10.0

bgpd: Fix `enforce-first-as` per peer-group removal (backport)

4 months agobgpd: Fix `enforce-first-as` per peer-group removal 17714/head
Donatas Abraitis [Sat, 21 Dec 2024 15:03:14 +0000 (17:03 +0200)]
bgpd: Fix `enforce-first-as` per peer-group removal

If we do `no neighbor PG enforce-first-as`, it wasn't working because the flag
was inherited incorrectly for the members of the peer-group.

Fixes: 322462920e2a2c8b73191c6eb5157d64cf4a593e ("bgpd: Enable enforce-first-as by default")
Closes: https://github.com/FRRouting/frr/issues/17702
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agoMerge pull request #17701 from opensourcerouting/fix/backport_b0800bfdf04b4fcf4850473...
Jafar Al-Gharaibeh [Sun, 22 Dec 2024 04:55:10 +0000 (22:55 -0600)]
Merge pull request #17701 from opensourcerouting/fix/backport_b0800bfdf04b4fcf48504737ebfe4ba7f05268d3

bgpd: Validate only affected RPKI prefixes instead of a full RIB (backport)

4 months agoMerge pull request #17688 from FRRouting/mergify/bp/stable/10.0/pr-17669
Donatas Abraitis [Sat, 21 Dec 2024 20:21:02 +0000 (22:21 +0200)]
Merge pull request #17688 from FRRouting/mergify/bp/stable/10.0/pr-17669

bgpd: fix memory leak when reconfiguring a route distinguisher (backport #17669)

4 months agobgpd: Validate only affected RPKI prefixes instead of a full RIB 17701/head
Donatas Abraitis [Wed, 4 Dec 2024 21:38:34 +0000 (23:38 +0200)]
bgpd: Validate only affected RPKI prefixes instead of a full RIB

Before this fix, if rpki_sync_socket_rtr socket returns EAGAIN, then ALL routes
in the RIB are revalidated which takes lots of CPU and some unnecessary traffic,
e.g. if using BMP servers. With a full feed it would waste 50-80Mbps.

Instead we should try to drain an existing pipe (another end), and revalidate
only affected prefixes.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agobgpd: fix memory leak when reconfiguring a route distinguisher 17688/head
Philippe Guibert [Wed, 18 Dec 2024 15:53:48 +0000 (16:53 +0100)]
bgpd: fix memory leak when reconfiguring a route distinguisher

A memory leak happens when reconfiguring an already configured route
distinguisher on an L3VPN BGP instance. Fix this by freeing the previous
route distinguisher.

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

4 months agoMerge pull request #17680 from FRRouting/mergify/bp/stable/10.0/pr-17675
Jafar Al-Gharaibeh [Fri, 20 Dec 2024 02:19:06 +0000 (20:19 -0600)]
Merge pull request #17680 from FRRouting/mergify/bp/stable/10.0/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 17680/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 #17658 from FRRouting/mergify/bp/stable/10.0/pr-17615
Jafar Al-Gharaibeh [Wed, 18 Dec 2024 00:38:52 +0000 (18:38 -0600)]
Merge pull request #17658 from FRRouting/mergify/bp/stable/10.0/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 17658/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 #17632 from opensourcerouting/fix/backport_9b0b9282d317a9aeab36d9a...
Donald Sharp [Wed, 11 Dec 2024 12:20:36 +0000 (07:20 -0500)]
Merge pull request #17632 from opensourcerouting/fix/backport_9b0b9282d317a9aeab36d9a8b08a35fe9a172c4b_10.0

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

4 months agobgpd: Fix bgp core with a possible Intf delete 17632/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 #17596 from opensourcerouting/fix/backport_12a9ca4de6c781b061cccdf...
Jafar Al-Gharaibeh [Thu, 5 Dec 2024 15:25:28 +0000 (09:25 -0600)]
Merge pull request #17596 from opensourcerouting/fix/backport_12a9ca4de6c781b061cccdf3e793346e23558901_10.0

bgpd: fix unconfigure asdot neighbor (backport)

4 months agobgpd: fix unconfigure asdot neighbor 17596/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 #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 17564/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 17560/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 #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 17524/head
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 17513/head
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 17489/head
Donatas Abraitis [Fri, 22 Nov 2024 08:30:37 +0000 (10:30 +0200)]
bgpd: Do not reset peers on suppress-fib toggling

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

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

5 months agoMerge pull request #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)