]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
5 weeks agobgpd: Fix holdtime not working properly when busy mergify/bp/stable/10.3/pr-18483 18485/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>
(cherry picked from commit 9a26a56c5188fd1c95e244932bc17f97b9051935)

5 weeks agoMerge pull request #18463 from FRRouting/mergify/bp/stable/10.3/pr-18378
Donald Sharp [Sun, 23 Mar 2025 19:17:47 +0000 (15:17 -0400)]
Merge pull request #18463 from FRRouting/mergify/bp/stable/10.3/pr-18378

bgpd: fix `set evpn gateway-ip ipv[46]` route-map (backport #18378)

5 weeks agobgpd: fix evpn attributes being dropped on input mergify/bp/stable/10.3/pr-18378 18463/head
Tuetuopay [Mon, 17 Mar 2025 14:08:15 +0000 (15:08 +0100)]
bgpd: fix evpn attributes being dropped on input

All assignments of the EVPN attributes (ESI and Gateway IP) are gated
behind the peer being set up for inbound soft-reconfiguration.

There are no actual reasons for this limitation, so let's perform the
EVPN attribute assignment no matter what when soft reconfiguration is
not enabled.

Fixes: 6e076ba5231 ("bgpd: Fix for ain->attr corruption during path update")
Signed-off-by: Tuetuopay <tuetuopay@me.com>
(cherry picked from commit 7320659f78cbe86dd983d5101831120fc14583d7)

5 weeks agotests: add route-map evpn set gateway-ip topotest
Tuetuopay [Fri, 14 Mar 2025 19:21:53 +0000 (20:21 +0100)]
tests: add route-map evpn set gateway-ip topotest

This test does not actually look at the route since the gateway-ip is
not exposed in vtysh output. However, this ensures such a route-map does
not crash bgpd.

Signed-off-by: Tuetuopay <tuetuopay@me.com>
(cherry picked from commit 05a74323b9d440590074f22be11c34a605da69ad)

5 weeks agobgpd: fix `set evpn gateway-ip ipv[46]` route-map
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 #18455 from FRRouting/mergify/bp/stable/10.3/pr-18108
Donald Sharp [Sat, 22 Mar 2025 19:23:23 +0000 (15:23 -0400)]
Merge pull request #18455 from FRRouting/mergify/bp/stable/10.3/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.3/pr-18108 18455/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 #18437 from FRRouting/mergify/bp/stable/10.3/pr-18435
Donald Sharp [Thu, 20 Mar 2025 12:26:50 +0000 (08:26 -0400)]
Merge pull request #18437 from FRRouting/mergify/bp/stable/10.3/pr-18435

bgpd: Fix leaked memory when showing some bgp routes (backport #18435)

5 weeks agoMerge pull request #18439 from Jafaral/rpm-fix
Donald Sharp [Thu, 20 Mar 2025 12:26:35 +0000 (08:26 -0400)]
Merge pull request #18439 from Jafaral/rpm-fix

Fix rpm packaging for 10.3 (manual backport #18426)

5 weeks agoredhat: Make sure zeromq is always disabled 18439/head
Martin Winter [Wed, 19 Mar 2025 12:40:53 +0000 (13:40 +0100)]
redhat: Make sure zeromq is always disabled

Fix issue where zeromq is getting enabled if build system has the libs
installed. For RPMs, we want it always based on intended config options.
(and currently the zeromq is not part of the packages)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 weeks agoredhat: Make docs and rpki optional for RPM package build
Martin Winter [Wed, 19 Mar 2025 06:21:37 +0000 (07:21 +0100)]
redhat: Make docs and rpki optional for RPM package build

Adding options to disable docs and rpki during the build. By
default they are always built. RPKI sub-package will not be built
(and not available) if built without the RPKI support.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 weeks agoRevert "redhat: Add option to build pkg without docs and rpki support, allow for...
Martin Winter [Wed, 19 Mar 2025 06:07:44 +0000 (07:07 +0100)]
Revert "redhat: Add option to build pkg without docs and rpki support, allow for different system environments by including all built .so files"

This reverts commit d89f21fc0602761f5adb0dd82b8c6e24a5636a20.

Reverting original change from PR 17793. This commit breaks RPKI
and SNMP sub-packages

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 weeks agobgpd: Fix leaked memory when showing some bgp routes 18437/head
Donald Sharp [Wed, 19 Mar 2025 20:50:11 +0000 (16:50 -0400)]
bgpd: Fix leaked memory when showing some bgp routes

The two memory leaks:

==387155== 744 (48 direct, 696 indirect) bytes in 1 blocks are definitely lost in loss record 222 of 262
==387155==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==387155==    by 0x4C1B982: json_object_new_object (in /usr/lib/x86_64-linux-gnu/libjson-c.so.5.1.0)
==387155==    by 0x2E4146: peer_adj_routes (bgp_route.c:15245)
==387155==    by 0x2E4F1A: show_ip_bgp_instance_neighbor_advertised_route_magic (bgp_route.c:15549)
==387155==    by 0x2B982B: show_ip_bgp_instance_neighbor_advertised_route (bgp_route_clippy.c:722)
==387155==    by 0x4915E6F: cmd_execute_command_real (command.c:1003)
==387155==    by 0x4915FE8: cmd_execute_command (command.c:1062)
==387155==    by 0x4916598: cmd_execute (command.c:1228)
==387155==    by 0x49EB858: vty_command (vty.c:626)
==387155==    by 0x49ED77C: vty_execute (vty.c:1389)
==387155==    by 0x49EFFA7: vtysh_read (vty.c:2408)
==387155==    by 0x49E4156: event_call (event.c:2019)
==387155==    by 0x4958ABD: frr_run (libfrr.c:1247)
==387155==    by 0x206A68: main (bgp_main.c:557)
==387155==
==387155== 2,976 (192 direct, 2,784 indirect) bytes in 4 blocks are definitely lost in loss record 240 of 262
==387155==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==387155==    by 0x4C1B982: json_object_new_object (in /usr/lib/x86_64-linux-gnu/libjson-c.so.5.1.0)
==387155==    by 0x2E45CA: peer_adj_routes (bgp_route.c:15325)
==387155==    by 0x2E4F1A: show_ip_bgp_instance_neighbor_advertised_route_magic (bgp_route.c:15549)
==387155==    by 0x2B982B: show_ip_bgp_instance_neighbor_advertised_route (bgp_route_clippy.c:722)
==387155==    by 0x4915E6F: cmd_execute_command_real (command.c:1003)
==387155==    by 0x4915FE8: cmd_execute_command (command.c:1062)
==387155==    by 0x4916598: cmd_execute (command.c:1228)
==387155==    by 0x49EB858: vty_command (vty.c:626)
==387155==    by 0x49ED77C: vty_execute (vty.c:1389)
==387155==    by 0x49EFFA7: vtysh_read (vty.c:2408)
==387155==    by 0x49E4156: event_call (event.c:2019)
==387155==    by 0x4958ABD: frr_run (libfrr.c:1247)
==387155==    by 0x206A68: main (bgp_main.c:557)

For the 1st one, if the operator issues a advertised-routes command, the
json_ar variable was never being freed.

For the 2nd one, if the operator issued a command where the
output_count_per_rd is 0, we need to free the json_routes value.

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

5 weeks agoMerge pull request #18433 from FRRouting/mergify/bp/stable/10.3/pr-18430
Donald Sharp [Thu, 20 Mar 2025 00:42:47 +0000 (20:42 -0400)]
Merge pull request #18433 from FRRouting/mergify/bp/stable/10.3/pr-18430

lib: Create VRF if needed (backport #18430)

5 weeks agolib: Create VRF if needed mergify/bp/stable/10.3/pr-18430 18433/head
Nathan Bahr [Wed, 19 Mar 2025 16:07:37 +0000 (16:07 +0000)]
lib: Create VRF if needed

When creating a control plane protocol through NB, create the vrf
if needed instead of only looking up and asserting if it doesn't
exist yet.
Fixes 18429.

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

5 weeks agoMerge pull request #18422 from FRRouting/mergify/bp/stable/10.3/pr-18393
Jafar Al-Gharaibeh [Wed, 19 Mar 2025 14:55:12 +0000 (09:55 -0500)]
Merge pull request #18422 from FRRouting/mergify/bp/stable/10.3/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... 18422/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 #18402 from FRRouting/mergify/bp/stable/10.3/pr-18387
Donald Sharp [Mon, 17 Mar 2025 12:15:46 +0000 (08:15 -0400)]
Merge pull request #18402 from FRRouting/mergify/bp/stable/10.3/pr-18387

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

6 weeks agobgpd: Fixed crash upon bgp network import-check command 18402/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)

6 weeks agoMerge pull request #18391 from FRRouting/mergify/bp/stable/10.3/pr-18360
Donatas Abraitis [Sat, 15 Mar 2025 17:33:01 +0000 (18:33 +0100)]
Merge pull request #18391 from FRRouting/mergify/bp/stable/10.3/pr-18360

zebra: ensure proper return for failure for Sid allocation (backport #18360)

6 weeks agozebra: ensure proper return for failure for Sid allocation 18391/head
Rajasekar Raja [Mon, 10 Mar 2025 22:26:38 +0000 (15:26 -0700)]
zebra: ensure proper return for failure for Sid allocation

The functions alloc_srv6_sid_func_explicit/dynamic expect to return bool
but we have places where we return a -1 or NULL which the caller is
assuming as a True/Valid and ending up allocating Sid

Without Fix:
2025/03/10 21:44:04.295350 ZEBRA: [XWV20-TGK70] alloc_srv6_sid_func_explicit: trying to allocate explicit SID function 65088 from block fcbb:bbbb::/32
2025/03/10 21:44:04.295351 ZEBRA: [MM61M-TQZNP] alloc_srv6_sid_func_explicit: elib s 10000 e 20000 wlib s 1000 ewlib s 30000 e 1000 SID_FUNC 65088
2025/03/10 21:44:04.295352 ZEBRA: [QGHMB-SWNFW] alloc_srv6_sid_func_explicit: function 65088 is outside ELIB [10000/20000] and EWLIB alloc ranges [30000/1000]
2025/03/10 21:44:04.295367 ZEBRA: [H0GZA-NNSWJ] get_srv6_sid_explicit: allocated explicit SRv6 SID fcbb:bbbb:1:fe40:: for context End.X nh6 2001::2
2025/03/10 21:44:04.295368 ZEBRA: [XBBYD-T1Q7P] srv6_manager_get_sid_internal: got new SRv6 SID for ctx End.X nh6 2001::2: sid_value=fcbb:bbbb:1:fe40:: (func=65088) (proto=4, instance=0, sessionId=0), notifying all clients

With Fix:
2025/03/10 22:04:25.052235 ZEBRA: [MM61M-TQZNP] alloc_srv6_sid_func_explicit: elib s 30000 e 31000 wlib s 31000 ewlib s 30000 e 31000 SID_FUNC 65056
2025/03/10 22:04:25.052236 ZEBRA: [YHMRC-EMYNX] alloc_srv6_sid_func_explicit: function 65056 is outside ELIB [30000/31000] and EWLIB alloc ranges [30000/31000]
2025/03/10 22:04:25.052254 ZEBRA: [XSG8X-Q2XJX] get_srv6_sid_explicit: invalid SM request arguments: failed to allocate SID function 65056 from block fcbb:bbbb::/32
2025/03/10 22:04:25.052257 ZEBRA: [YC52T-427SJ] srv6_manager_get_sid_internal: not got SRv6 SID for ctx End.DT6 vrf_id 4, sid_value=fcbb:bbbb:1:fe20::, locator_name=MAIN
root@rajasekarr:/tmp/topotests/static_srv6_sids.test_static_srv6_sids/r1#

Ticket :#
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit 5a63cf4c0d1e7b84f59003877599c6575ba08a25)

7 weeks agoFRR Release 10.3 rc/10.3 docker/10.3.0 frr-10.3
Jafar Al-Gharaibeh [Mon, 10 Mar 2025 04:11:11 +0000 (23:11 -0500)]
FRR Release 10.3

- Major highlights:
-   Lua 5.4 support
-   Fixed CVE-2024-55553
-   New match community-count BGP command to limit communities count
-   New set metric igp|aigp BGP command to inject IGP metric as MED into BGP
-   New bgp ipv6-auto-ra BGP command
-   Optimize BGP EVPN L2VNI/L3VIN remote routes processing
-   Respect non-transitive BGP extended communities between direct peers
-   Drop deprecated bgp network import-check exact command
-   Handle BGP ENHE (Extended Next Hop Encoding) capability via dynamic capability
-   Implement BGP connect backoff retry
-   Implement an ability to import BMP information from a separate BGP instance
-   Add support of BGP color extended community color-only types
-   Implement SBFD
-   Add support for SRv6 static SIDs
-   Implement embedded-rp for PIMv6
-   Implement AutoRP mapping-agent for PIM
-   Implement MSDP peer SA limiting

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
7 weeks agodebian, redhat: updating changelog for new release
Jafar Al-Gharaibeh [Mon, 10 Mar 2025 04:08:40 +0000 (23:08 -0500)]
debian, redhat: updating changelog for new release

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
7 weeks agoMerge pull request #18353 from FRRouting/mergify/bp/dev/10.3/pr-18348
Jafar Al-Gharaibeh [Mon, 10 Mar 2025 03:22:38 +0000 (22:22 -0500)]
Merge pull request #18353 from FRRouting/mergify/bp/dev/10.3/pr-18348

Topotest startup order (backport #18348)

7 weeks agoMerge pull request #18352 from FRRouting/mergify/bp/dev/10.3/pr-18338
Jafar Al-Gharaibeh [Sun, 9 Mar 2025 17:34:29 +0000 (12:34 -0500)]
Merge pull request #18352 from FRRouting/mergify/bp/dev/10.3/pr-18338

Documentation typesafe (backport #18338)

7 weeks agotests: Have zebra startup look for the zserv.api socket 18353/head
Donald Sharp [Fri, 7 Mar 2025 23:39:33 +0000 (18:39 -0500)]
tests: Have zebra startup look for the zserv.api socket

Ensure that the zserv.api socket is actually up and running
before moving onto other daemons after zebra.

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

7 weeks agotests: Allow mgmtd and zebra to fully come up before other daemons
Donald Sharp [Fri, 7 Mar 2025 23:35:53 +0000 (18:35 -0500)]
tests: Allow mgmtd and zebra to fully come up before other daemons

Currently the topotest infrastructure is starting up daemons
in mgmtd,zebra, staticd then everything else.

The problem that is happening, under heavy load, is that
zebra may not be fully started and when a daemon attempts
to connect to it, it will not be able to connect.
Some of the daemons do not have great retry mechanisms at all.
In addition our normal systemctl startup scripts actually
wait a small amount of time for zebra to be ready before
moving onto the other daemons.

Let's make topotests startup a tiny bit more nuanced
and have mgmtd fully up before starting up zebra.

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

7 weeks agodoc: The sbfd documentation was not being included 18352/head
Donald Sharp [Fri, 7 Mar 2025 02:54:42 +0000 (21:54 -0500)]
doc: The sbfd documentation was not being included

Add the sbfd documentation, such as it is, to the
developer documentation so that it can be read
by people.

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

7 weeks agodoc: Developer documentation missing some build instructions
Donald Sharp [Fri, 7 Mar 2025 02:49:12 +0000 (21:49 -0500)]
doc: Developer documentation missing some build instructions

The building-frr-for-ubuntu2404 and building-doc were missing
from the compilation of developer documents.

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

7 weeks agodoc: Add typesafe conversion examples
Donald Sharp [Fri, 7 Mar 2025 02:43:10 +0000 (21:43 -0500)]
doc: Add typesafe conversion examples

Try to give some good examples of various lists being
converted over to the typesafe way of doing things.

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

7 weeks agoMerge pull request #18331 from FRRouting/mergify/bp/dev/10.3/pr-18214
Donald Sharp [Fri, 7 Mar 2025 01:33:21 +0000 (20:33 -0500)]
Merge pull request #18331 from FRRouting/mergify/bp/dev/10.3/pr-18214

zebra: Bring up 514 BGP neighbor sessions (backport #18214)

7 weeks agoMerge pull request #18332 from FRRouting/mergify/bp/dev/10.3/pr-18315
Donald Sharp [Fri, 7 Mar 2025 01:33:02 +0000 (20:33 -0500)]
Merge pull request #18332 from FRRouting/mergify/bp/dev/10.3/pr-18315

pimd: Fix PIM6 MLD VRF support (use recvmsg() pktinfo) (backport #18315)

7 weeks agopimd: Fix PIM6 MLD VRF support (use recvmsg() pktinfo) 18332/head
Martin Buck [Tue, 4 Mar 2025 13:24:33 +0000 (14:24 +0100)]
pimd: Fix PIM6 MLD VRF support (use recvmsg() pktinfo)

When receiving MLD messages, prefer pktinfo over msghdr.msg_name for
determining the source interface. The latter is just the VRF master
interface in case of VRF and we need the true interface the packet was
received on instead.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
(cherry picked from commit 374c8dc4dbc8a560036fecdfb3213f690099b869)

7 weeks agotests: add support for 514 unnumbered/v4/v6 BGP sessions 18331/head
Soumya Roy [Sat, 1 Mar 2025 01:21:11 +0000 (17:21 -0800)]
tests: add support for 514 unnumbered/v4/v6 BGP sessions

Signed-off-by: Soumya Roy <souroy@nvidia.com>
(cherry picked from commit 10ff0d5e4cf08dacf2bf82b2350dac403633e380)

7 weeks agotests: add support for bringimg up 514 BGP neighbors
Soumya Roy [Mon, 24 Feb 2025 18:53:45 +0000 (10:53 -0800)]
tests: add support for bringimg up 514 BGP neighbors

Signed-off-by: Soumya Roy <souroy@nvidia.com>
(cherry picked from commit fd80124ccab4afed32c09437986ad1347440fc81)

7 weeks agozebra: Bring up 514 BGP neighbor sessions
Soumya Roy [Sat, 15 Feb 2025 02:13:37 +0000 (18:13 -0800)]
zebra: Bring up 514 BGP neighbor sessions

Issue:
When 514 inerfaces/neighbors are configured, it creates socket error,
"Cannot allocate memory", when back to back V6 RA messages are tried
to be sent over the socket. This prevents interface, to know its peer's
link local address. Socket error comes when 1) try to join ICMPv6 all
router multicast group, back to back for all interfaces 2)send back to
back RA for all interfaces

Fix:
1)For ICMPv6 join case, we check if the interface has already joined
all router group, if not try to join. On failure, retry joining after
random amount of time determined 1 ms to ICMPV6_JOIN_TIMER_EXP_MS(100 ms)
2) For RA issue case, batch sending of RA mesages using wheel timer

Testing:
Monitor BGP session running sh bgp summary command

Before fix:
r1# sh bgp summary

IPv4 Unicast Summary:
BGP router identifier 192.168.1.1, local AS number 1001 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 515, using 12 MiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
r1-eth0         4       1002        89        90        0    0    0 00:07:10            0        0 N/A
r1-eth1         4       1002        89        90        0    0    0 00:07:10            0        0 N/A
r1-eth2         4       1002        89        90        0    0    0 00:07:10            0        0 N/A
r1-eth3         4       1002        89        90        0    0    0 00:07:10            0        0 N/A
r1-eth4         4       1002        89        90        0    0    0 00:07:10            0        0 N/A
r1-eth5         4       1002        89        90        0    0    0 00:07:10            0        0 N/A

…..<snip>...
r1-eth252       4       1002        31        29        0    0    0 00:02:08            0        0 N/A
r1-eth253       4       1002        31        29        0    0    0 00:02:08            0        0 N/A
r1-eth254       4       1002        31        29        0    0    0 00:02:08            0        0 N/A
r1-eth255       4       1002        31        29        0    0    0 00:02:08            0        0 N/A
r1-eth256       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth257       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth258       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth259       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth260       4          0         0         0        0    0    0    never         Idle        0 N/A
……..<snip>…..
r1-eth511       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth512       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth513       4          0         0         0        0    0    0    never         Idle        0 N/A
r1-eth514       4          0         0         0        0    0    0    never         Idle        0 N/A
After fix:
r1# show bgp summary

IPv4 Unicast Summary:
BGP router identifier 192.168.1.1, local AS number 1001 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 515, using 12 MiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
r1-eth0         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth1         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth2         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth3         4       1002        64        67        0    0    0 00:05:09            0        0 N/A
r1-eth4         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth5         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth6         4       1002        67        70        0    0    0 00:05:22            0        0 N/A
r1-eth7         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
r1-eth8         4       1002        87        87        0    0    0 00:07:04            0        0 N/A
....
r1-eth499       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth500       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth501       4       1002        19        22        0    0    0 00:01:21            0        0 N/A
r1-eth502       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth503       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth504       4       1002        20        23        0    0    0 00:01:30            0        0 N/A
r1-eth505       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth506       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth507       4       1002        22        25        0    0    0 00:01:39            0        0 N/A
r1-eth508       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth509       4       1002        17        20        0    0    0 00:01:13            0        0 N/A
r1-eth510       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth511       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth512       4       1002        19        22        0    0    0 00:01:22            0        0 N/A
r1-eth513       4       1002        43        43        0    0    0 00:03:22            0        0 N/A
r1-eth514       4       1002        43        43        0    0    0 00:03:22            0        0 N/A

Signed-off-by: Soumya Roy <souroy@nvidia.com>
(cherry picked from commit 6a75d33b5cb9f5a87d71d169e24c1ae15e1bd896)

8 weeks agoMerge pull request #18302 from LabNConsulting/chopps/fix-nb-bugs
Jafar Al-Gharaibeh [Mon, 3 Mar 2025 18:59:48 +0000 (12:59 -0600)]
Merge pull request #18302 from LabNConsulting/chopps/fix-nb-bugs

Bring in 2 northbound bug-fixes from master to 10.3

8 weeks agolib: nb: fix bug with oper-state query on list data 18302/head
Christian Hopps [Wed, 26 Feb 2025 13:34:59 +0000 (13:34 +0000)]
lib: nb: fix bug with oper-state query on list data

The capacity of the xpath string was not guaranteed to be sufficient to hold all
the key predicates and so would truncate. Calculate the required space and
guarantee that it is available.

Signed-off-by: Christian Hopps <chopps@labn.net>
8 weeks agolib: nb: fix bug with keyless list specific index lookup
Christian Hopps [Mon, 3 Mar 2025 15:43:34 +0000 (15:43 +0000)]
lib: nb: fix bug with keyless list specific index lookup

Signed-off-by: Christian Hopps <chopps@labn.net>
8 weeks agoMerge pull request #18291 from FRRouting/mergify/bp/dev/10.3/pr-18290
Donald Sharp [Mon, 3 Mar 2025 15:35:27 +0000 (10:35 -0500)]
Merge pull request #18291 from FRRouting/mergify/bp/dev/10.3/pr-18290

tools: Fix `frr-reload.py` error related to `static-sids` (backport #18290)

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

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

8 weeks agoMerge pull request #18292 from FRRouting/mergify/bp/dev/10.3/pr-18289
Donald Sharp [Mon, 3 Mar 2025 14:38:03 +0000 (09:38 -0500)]
Merge pull request #18292 from FRRouting/mergify/bp/dev/10.3/pr-18289

staticd: Fix `no srv6` command (backport #18289)

8 weeks agoisisd: Correct edge insertion into TED 18296/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)

8 weeks agotests: Add test case to verify that SIDs can be re-added 18292/head
Carmine Scarpitta [Wed, 26 Feb 2025 15:08:33 +0000 (16:08 +0100)]
tests: Add test case to verify that SIDs can be re-added

Add a test case to verify that staticd is able to re-install all SIDs
after disabling and re-enabling SRv6.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 0e0eca6c5f287c936570a3be50dde120ade1b9b8)

8 weeks agotests: Add test case to verify `no srv6` command
Carmine Scarpitta [Wed, 26 Feb 2025 15:08:17 +0000 (16:08 +0100)]
tests: Add test case to verify `no srv6` command

Add a test case to verify that staticd removes all SIDs when the
`no srv6` command is executed.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 58373a61d559036990b875bbf0afdc9e92174975)

8 weeks agostaticd: Fix `no srv6` command
Carmine Scarpitta [Tue, 25 Feb 2025 23:24:49 +0000 (00:24 +0100)]
staticd: Fix `no srv6` command

A user can configure static SIDs as follows:

[...]
segment-routing
 srv6
  static-sids
   sid fcbb:bbbb:1::/48 locator MAIN behavior uN
   sid fcbb:bbbb:1:fe00::/64 locator MAIN behavior uDT46
[...]

When the user runs vtysh and executes the `no srv6` command, the
expectation is that staticd will deallocate all SIDs.

However, currently FRR does not behaves as expected. After the user
executes `no srv6`, the SIDs are still present.

The problem is that vtysh does not forward the `no srv6` command to
mgmtd/staticd.

The `no srv6` command is defined using the `DEFUN_YANG_NOSH` macro,
which instructs `xref2vtysh.py` to skip the `no srv6` command during
the generation of `vtysh_cmd.c`. As a result, vtysh is unaware that it
should forward the `no srv6` command to mgmtd/staticd.

This commit fixes the issue by replacing `DEFUN_YANG_NOSH` with
`DEFUN_YANG`. This change ensures that `xref2vtysh.py` includes the
`no srv6` command when generating `vtysh_cmd.c` and makes vtysh forward
the `no srv6` command to mgmtd/staticd.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit b94be4a1c5ad6de7547a64d20a2f5124780fe4e7)

8 weeks agotools: Fix `frr-reload.py` error related to `static-sids` 18291/head
Carmine Scarpitta [Sat, 1 Mar 2025 23:02:57 +0000 (00:02 +0100)]
tools: Fix `frr-reload.py` error related to `static-sids`

```
[...]
segment-routing
 srv6
  static-sids
   sid fcbb:bbbb:1::/48 locator MAIN behavior uN
   sid fcbb:bbbb:1:fe10::/64 locator MAIN behavior uDT4 vrf Vrf10
   sid fcbb:bbbb:1:fe20::/64 locator MAIN behavior uDT6 vrf Vrf20
   sid fcbb:bbbb:1:fe30::/64 locator MAIN behavior uDT46 vrf Vrf30
   sid fcbb:bbbb:1:fe40::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2
[...]
```

When the user has a configuration like the one above and runs the
command `frr-reload.py --reload`, the following error occurs:

```
[1129654|mgmtd] sending configuration
line 17: % Unknown command[76]:   sid fcbb:bbbb:1::/48 locator MAIN behavior uN
line 23: % Unknown command[76]:   sid fcbb:bbbb:1:fe10::/64 locator MAIN behavior uDT4 vrf Vrf10
line 29: % Unknown command[76]:   sid fcbb:bbbb:1:fe20::/64 locator MAIN behavior uDT6 vrf Vrf20
line 35: % Unknown command[76]:   sid fcbb:bbbb:1:fe30::/64 locator MAIN behavior uDT46 vrf Vrf30
line 41: % Unknown command[76]:   sid fcbb:bbbb:1:fe40::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2
```

The problem is that in `frr-reload-py` all commands that start a new
multi-line context must be included in the `ctx_keyword` dictionary.
However, the `static-sids` command is not part of the `ctx_keyword`
dictionary.

This commit fixes the problem by adding `static-sids` to `ctx_keyword`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit a515de1c46f617ee3608ab55cdef5f2a262d387a)

8 weeks agoMerge pull request #18265 from FRRouting/mergify/bp/dev/10.3/pr-18254
Jafar Al-Gharaibeh [Sat, 1 Mar 2025 21:02:53 +0000 (15:02 -0600)]
Merge pull request #18265 from FRRouting/mergify/bp/dev/10.3/pr-18254

ospf6d: Fix use after free of router in OSPFv3 ABR route calculation. (backport #18254)

8 weeks agoMerge pull request #18284 from FRRouting/mergify/bp/dev/10.3/pr-18263
Jafar Al-Gharaibeh [Fri, 28 Feb 2025 20:46:40 +0000 (14:46 -0600)]
Merge pull request #18284 from FRRouting/mergify/bp/dev/10.3/pr-18263

staticd: Add `no` form for `static-sids` command (backport #18263)

8 weeks agotests: Add test case to verify that SIDs can be re-added 18284/head
Carmine Scarpitta [Wed, 26 Feb 2025 14:38:06 +0000 (15:38 +0100)]
tests: Add test case to verify that SIDs can be re-added

Add a test case to verify that staticd is able to re-install all SIDs
after deleting and re-adding them.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 641f0c6deb483c78a5cf2d69ec5335e5d4e498a5)

8 weeks agotests: Add test case to verify `no static-sids` command
Carmine Scarpitta [Wed, 26 Feb 2025 14:36:00 +0000 (15:36 +0100)]
tests: Add test case to verify `no static-sids` command

Add a test case to verify that staticd removes all SIDs when the
`no static-sids` command is executed.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 303be67e6ab185954b05c16c499a6b258311d897)

8 weeks agovtysh: Add `no static-sids` command
Carmine Scarpitta [Thu, 27 Feb 2025 11:12:39 +0000 (12:12 +0100)]
vtysh: Add `no static-sids` command

Previous commits introduced the `no` form for the `static-sids` command.
This change allow users to remove all static SIDs at once.

This commit makes the `no static-sids` command available in vtysh.

```
router# config
router(config)# segment-routing
router(sr)# srv6
router(srv6)# no static-sids
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 96134d196490c304b3b78487b06f0d34ce488651)

8 weeks agostaticd: Add `no` form for `static-sids` command
Carmine Scarpitta [Wed, 26 Feb 2025 14:34:19 +0000 (15:34 +0100)]
staticd: Add `no` form for `static-sids` command

Currently, when the user tries to delete all static SIDs with the
`no static-sids` command, staticd returns an error.

```
router# config
router(config)# segment-routing
router(sr)# srv6
router(srv6)# no static-sids
% Unknown command: no  static-sids
```

The problem is the `static-sids` command does not support the `no` form.

This PR enables the `no` form for the `static-sids` command.

```
router# config
router(config)# segment-routing
router(sr)# srv6
router(srv6)# no static-sids
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit ab7a7541a669ebe586d8de8015e7eb68c0365c2b)

8 weeks agostaticd: Convert `static-sids` command to DEFPY
Carmine Scarpitta [Wed, 26 Feb 2025 09:17:56 +0000 (10:17 +0100)]
staticd: Convert `static-sids` command to DEFPY

This commit converts the `static-sids` command from `DEFUN` to `DEFPY`
to simplify the parsing of the command string definition.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit e7640f388538cba10bf954460315c7c9fac22d04)

8 weeks agoMerge pull request #18279 from FRRouting/mergify/bp/dev/10.3/pr-18264
Jafar Al-Gharaibeh [Fri, 28 Feb 2025 04:09:18 +0000 (22:09 -0600)]
Merge pull request #18279 from FRRouting/mergify/bp/dev/10.3/pr-18264

mgmtd: Prevent use after free (backport #18264)

8 weeks agomgmtd: Prevent use after free 18279/head
Donald Sharp [Wed, 26 Feb 2025 17:34:05 +0000 (12:34 -0500)]
mgmtd: Prevent use after free

ci is picking up this use after free on occasion:

    ERROR: AddressSanitizer: attempting to call malloc_usable_size() for pointer which is not owned: 0x6030001d94a0
        0 0x7fab994b7f04 in __interceptor_malloc_usable_size ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:119
        1 0x7fab994264f6 in __sanitizer::BufferedStackTrace::Unwind(unsigned long, unsigned long, void*, bool, unsigned int) ../../../../src/libsanitizer/sanitizer_common/sanitizer_stacktrace.h:131
        2 0x7fab994264f6 in __asan::asan_malloc_usable_size(void const*, unsigned long, unsigned long) ../../../../src/libsanitizer/asan/asan_allocator.cpp:1058
        3 0x7fab99039bcf in mt_count_free lib/memory.c:78
        4 0x7fab99039bcf in qfree lib/memory.c:130
        5 0x7fab98ff971a in hash_clean lib/hash.c:290
        6 0x56110cdb0e7f in mgmt_txn_hash_destroy mgmtd/mgmt_txn.c:1881
        7 0x56110cdb0e7f in mgmt_txn_destroy mgmtd/mgmt_txn.c:2013
        8 0x56110cd8e5de in mgmt_terminate mgmtd/mgmt.c:91
        9 0x56110cd8e003 in sigint mgmtd/mgmt_main.c:90
        10 0x7fab990bf4b0 in frr_sigevent_process lib/sigevent.c:117
        11 0x7fab990ea7a1 in event_fetch lib/event.c:1740
        12 0x7fab9901a24e in frr_run lib/libfrr.c:1245
        13 0x56110cd8e21f in main mgmtd/mgmt_main.c:290
        14 0x7fab98af9249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
        15 0x7fab98af9304 in __libc_start_main_impl ../csu/libc-start.c:360
        16 0x56110cd8dd30 in _start (/usr/lib/frr/mgmtd+0x3ad30)

    0x6030001d94a0 is located 0 bytes inside of 24-byte region [0x6030001d94a0,0x6030001d94b8)
    freed by thread T0 here:
        0 0x7fab994b76a8 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52
        1 0x7fab99039bf0 in qfree lib/memory.c:131
        2 0x7fab98ff93e1 in hash_release lib/hash.c:227
        3 0x56110cdaabdc in mgmt_txn_unlock mgmtd/mgmt_txn.c:1931
        4 0x56110cdab049 in mgmt_txn_delete mgmtd/mgmt_txn.c:1841
        5 0x56110cdab0ce in mgmt_txn_hash_free mgmtd/mgmt_txn.c:1864
        6 0x7fab98ff970b in hash_clean lib/hash.c:288
        7 0x56110cdb0e7f in mgmt_txn_hash_destroy mgmtd/mgmt_txn.c:1881
        8 0x56110cdb0e7f in mgmt_txn_destroy mgmtd/mgmt_txn.c:2013
        9 0x56110cd8e5de in mgmt_terminate mgmtd/mgmt.c:91
        10 0x56110cd8e003 in sigint mgmtd/mgmt_main.c:90
        11 0x7fab990bf4b0 in frr_sigevent_process lib/sigevent.c:117
        12 0x7fab990ea7a1 in event_fetch lib/event.c:1740
        13 0x7fab9901a24e in frr_run lib/libfrr.c:1245
        14 0x56110cd8e21f in main mgmtd/mgmt_main.c:290
        15 0x7fab98af9249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

    previously allocated by thread T0 here:
        0 0x7fab994b83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
        1 0x7fab990392fd in qcalloc lib/memory.c:106
        2 0x7fab98ff8b4f in hash_get lib/hash.c:156
        3 0x56110cdb13ae in mgmt_txn_create_new mgmtd/mgmt_txn.c:1825
        4 0x56110cdb3b4d in mgmt_txn_notify_be_adapter_conn mgmtd/mgmt_txn.c:2212
        5 0x56110cd91178 in mgmt_be_adapter_conn_init mgmtd/mgmt_be_adapter.c:842
        6 0x7fab990ec6de in event_call lib/event.c:2019
        7 0x7fab9901a243 in frr_run lib/libfrr.c:1246
        8 0x56110cd8e21f in main mgmtd/mgmt_main.c:290
        9 0x7fab98af9249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

The only time that mgmt_txn_hash_free is called is in hash_clean.
There are other places that mgmt_txn_unlock/delete are called and
hash_release should be called.  Let's just notice when mgmtd is
being called from the hash_clean and not call hash_release (since
we know it is being released already)

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

8 weeks agoMerge pull request #18272 from louis-6wind/bgp-hidden-10.3
Jafar Al-Gharaibeh [Thu, 27 Feb 2025 16:12:14 +0000 (10:12 -0600)]
Merge pull request #18272 from louis-6wind/bgp-hidden-10.3

bgpd: fix default instance when leaving the hidden state. (backport #18119)

2 months agotests: check as number in show run 18272/head
Louis Scalbert [Fri, 14 Feb 2025 10:58:24 +0000 (11:58 +0100)]
tests: check as number in show run

Creates the default VRF instance after the other VRF instances. The
default VRF instance is created in hidden state. Check that AS number
in show run is correctly written.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 077a2b0dfc71443b41d5feceb52023c259436956)
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agobgpd: fix leaving hidden state
Louis Scalbert [Fri, 14 Feb 2025 14:03:00 +0000 (15:03 +0100)]
bgpd: fix leaving hidden state

Upon configuration of a VRF instance that references an absent default
VRF with "import vrf default", the default instance is created in hidden
state. However, the default instance is not properly un-hidden when
configured.

Restore the behavior prior to commit below.

Fixes: 9f7177af13 ("bgpd: fix duplicate BGP instance created with unified config")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 70e07678bfe554dd5be30a605ddf6c0fe3a8a39b)
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agotests: add bgp_l3vpn_hidden topotest
Louis Scalbert [Fri, 14 Feb 2025 13:07:40 +0000 (14:07 +0100)]
tests: add bgp_l3vpn_hidden topotest

Test that leaving the hidden BGP instance state is working.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 118afe4690d5563887c1b2095d18e23cc77a21a2)
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agobgpd: update AS value of a hidden bgp instance
Alexander Skorichenko [Sat, 1 Feb 2025 00:52:17 +0000 (01:52 +0100)]
bgpd: update AS value of a hidden bgp instance

'import vrf VRF' could define a hidden bgp instance with
the default AS_UNSPECIFIED (i.e. = 1) value.
When a
router bgp AS vrf VRF
gets configured later on, replace this AS_UNSPECIFIED setting
with a requested value.

Fixes: 9680831518 ("bgpd: fix as_pretty mem leaks when un-hiding")
Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 1515a59202280933936b41c4cb2cb11c7889b279)
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agoRevert "bgpd: fix bgp vrf instance creation from implicit"
Louis Scalbert [Fri, 14 Feb 2025 17:01:00 +0000 (18:01 +0100)]
Revert "bgpd: fix bgp vrf instance creation from implicit"

This reverts commit 2ff08af78e315c69795417d150cd23649f68c655.

The fix is obviously wrong.

Link: 2ff08af78e315c69795417d150cd23649f68c655
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 339206341fa08c57316559eb3733d216236dfe9d)
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agobgpd: fix process_queue when un-hiding
Louis Scalbert [Wed, 12 Feb 2025 12:09:37 +0000 (13:09 +0100)]
bgpd: fix process_queue when un-hiding

bgp_process_queue_init() is not called in bgp_create() when leaving the
BGP instance hidden state because of the following goto:

> if (hidden) {
> bgp = bgp_old;
> goto peer_init;
> }

Upon reconfiguration of the default instance, the prefixes are never set
into a meta queue by mq_add_handler(). They are never processed for
zebra RIB installation and announcements of update/withdraw.

Do not delete the BGP process_queue when hiding.

Fixes: 4d0e7a49cf ("bgpd: VRF-Lite fix default bgp delete")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 71a3756f2dda272e69727fa416bca12c016d9567)
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agobgpd: fix default instance name when un-hiding
Louis Scalbert [Wed, 12 Feb 2025 11:56:49 +0000 (12:56 +0100)]
bgpd: fix default instance name when un-hiding

When unconfiguring a default BGP instance with VPN SAFI configurations,
the default BGP structure remains but enters a hidden state. Upon
reconfiguration, the instance name incorrectly appears as "VIEW ?"
instead of "VRF default". And the name_pretty pointer

The name_pretty pointer is replaced by another one with the incorrect
name. This also leads to a memory leak as the previous pointer is not
properly freed.

Do not rewrite the instance name.

Fixes: 4d0e7a49cf ("bgpd: VRF-Lite fix default bgp delete")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit d2ff7e8a2117ad4bc38cec0e48c6b3c11dc49c91)
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agoospf6d: Fix use after free of router in OSPFv3 ABR route calculation. 18265/head
Acee Lindem [Mon, 24 Feb 2025 21:44:32 +0000 (21:44 +0000)]
ospf6d: Fix use after free of router in OSPFv3 ABR route calculation.

This PR fixes FRR issue https://github.com/FRRouting/frr/issues/18040. The
OSPFv3 route is locked during the ABR calculation since there are
scenarios under which it is freed. The OSPFv3 ABR computation is
sub-optimal and this PR doesn't attempt to rework it.

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

2 months agoMerge pull request #18207 from FRRouting/mergify/bp/dev/10.3/pr-17666
Donald Sharp [Wed, 26 Feb 2025 16:15:31 +0000 (11:15 -0500)]
Merge pull request #18207 from FRRouting/mergify/bp/dev/10.3/pr-17666

pimd: During prefix-list update, behave as PIM_UPSTREAM_NOTJOINED sta… (backport #17666)

2 months agoMerge pull request #18255 from Jafaral/no-bgp-hidden
Donald Sharp [Wed, 26 Feb 2025 13:24:51 +0000 (08:24 -0500)]
Merge pull request #18255 from Jafaral/no-bgp-hidden

Revert "bgpd: fix default instance when leaving the hidden state (backport 10.3)" #18162

2 months agoMerge pull request #18227 from FRRouting/mergify/bp/dev/10.3/pr-18210
Russ White [Tue, 25 Feb 2025 15:40:48 +0000 (10:40 -0500)]
Merge pull request #18227 from FRRouting/mergify/bp/dev/10.3/pr-18210

bgpd: remove dmed check not required in bestpath selection (backport #18210)

2 months agoMerge pull request #18232 from FRRouting/mergify/bp/dev/10.3/pr-18231
Donald Sharp [Tue, 25 Feb 2025 15:38:16 +0000 (10:38 -0500)]
Merge pull request #18232 from FRRouting/mergify/bp/dev/10.3/pr-18231

Fix oper-state queries that involve choice/case nodes (backport #18231)

2 months agoMerge pull request #18244 from FRRouting/mergify/bp/dev/10.3/pr-18225
Donald Sharp [Tue, 25 Feb 2025 15:37:55 +0000 (10:37 -0500)]
Merge pull request #18244 from FRRouting/mergify/bp/dev/10.3/pr-18225

pim: Fix autorp group joins (backport #18225)

2 months agoMerge pull request #18246 from FRRouting/mergify/bp/dev/10.3/pr-18226
Donald Sharp [Tue, 25 Feb 2025 15:37:12 +0000 (10:37 -0500)]
Merge pull request #18246 from FRRouting/mergify/bp/dev/10.3/pr-18226

pim: Fix vrf binding of autorp and mroute socket (backport #18226)

2 months agoMerge pull request #18248 from FRRouting/mergify/bp/dev/10.3/pr-18216
Donald Sharp [Tue, 25 Feb 2025 15:36:56 +0000 (10:36 -0500)]
Merge pull request #18248 from FRRouting/mergify/bp/dev/10.3/pr-18216

pimd: Fix PIM VRF support (send register/register stop in VRF) (backport #18216)

2 months agoRevert "bgpd: fix default instance name when un-hiding" 18255/head
Jafar Al-Gharaibeh [Mon, 24 Feb 2025 23:17:30 +0000 (17:17 -0600)]
Revert "bgpd: fix default instance name when un-hiding"

This reverts commit 20664936afc7f952a51a19ab26daece5105bbee5.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 months agoRevert "bgpd: fix process_queue when un-hiding"
Jafar Al-Gharaibeh [Mon, 24 Feb 2025 23:17:27 +0000 (17:17 -0600)]
Revert "bgpd: fix process_queue when un-hiding"

This reverts commit a2c1956efa399c6770605712d0b53e5f24979acc.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 months agoReapply "bgpd: fix bgp vrf instance creation from implicit"
Jafar Al-Gharaibeh [Mon, 24 Feb 2025 23:17:10 +0000 (17:17 -0600)]
Reapply "bgpd: fix bgp vrf instance creation from implicit"

This reverts commit d9d74d33bca0e23a2cd4723fbc4709dc83fd1332.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 months agoRevert "bgpd: update AS value of a hidden bgp instance"
Jafar Al-Gharaibeh [Mon, 24 Feb 2025 23:17:09 +0000 (17:17 -0600)]
Revert "bgpd: update AS value of a hidden bgp instance"

This reverts commit 8e04277fff9597412198da123250e1951bfc580d.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 months agoRevert "tests: add bgp_l3vpn_hidden topotest"
Jafar Al-Gharaibeh [Mon, 24 Feb 2025 23:17:07 +0000 (17:17 -0600)]
Revert "tests: add bgp_l3vpn_hidden topotest"

This reverts commit bb79a6562ffd520329246920597f83ca32e9a468.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 months agoRevert "tests: check as number in show run"
Jafar Al-Gharaibeh [Mon, 24 Feb 2025 23:17:02 +0000 (17:17 -0600)]
Revert "tests: check as number in show run"

This reverts commit 85c5598bb95aa2eb17e8f617965affa7de627c69.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 months agopimd: Fix PIM VRF support (send register/register stop in VRF) 18248/head
Martin Buck [Fri, 21 Feb 2025 07:54:49 +0000 (08:54 +0100)]
pimd: Fix PIM VRF support (send register/register stop in VRF)

In 946195391406269003275850e1a4d550ea8db38b and
8ebcc02328c6b63ecf85e44fdfbf3365be27c127, transmission of PIM register and
register stop messages was changed to use a separate socket. However, that
socket is not bound to a possible VRF, so the messages were sent in the
default VRF instead. Call vrf_bind() once after socket creation and when the
VRF is ready to ensure transmission in the correct VRF. vrf_bind() handles
the non-VRF case (i.e. VRF_DEFAULT) automatically, so it may be called
unconditionally.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
(cherry picked from commit 5a01011e0d2db538a8ba523904bd4f08b786edfb)

2 months agopim: Fix vrf binding of autorp and mroute socket 18246/head
Nathan Bahr [Fri, 21 Feb 2025 17:55:16 +0000 (17:55 +0000)]
pim: Fix vrf binding of autorp and mroute socket

Bind the autorp socket to the vrf device.
Also fixed mroute socket to use vrf_bind instead of directly
setting the socket option.

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

2 months agopim: Fix autorp group joins 18244/head
Nathan Bahr [Fri, 21 Feb 2025 17:59:04 +0000 (17:59 +0000)]
pim: Fix autorp group joins

Group joining got broken when moving the autorp socket to open/close
as needed. This fixes it so autorp group joining is properly handled
as part of opening the socket.

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

2 months agotests: add unit-test for choice/case node queries 18232/head
Christian Hopps [Sat, 22 Feb 2025 14:09:38 +0000 (14:09 +0000)]
tests: add unit-test for choice/case node queries

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 73df7da40a107eab52a6819e6325d950ba569220)

2 months agolib: nb: fix oper-state queries that involve choice/case nodes
Christian Hopps [Sat, 22 Feb 2025 14:08:27 +0000 (14:08 +0000)]
lib: nb: fix oper-state queries that involve choice/case nodes

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit b9ff10b0863a81e95ca72778a2f1230b47ee2fae)

2 months agobgpd: remove dmed check not required in bestpath selection 18227/head
Donald Sharp [Thu, 20 Feb 2025 19:28:15 +0000 (14:28 -0500)]
bgpd: remove dmed check not required in bestpath selection

As part of the upstream master commit (f3575f61c7 bgpd: Sort the
bgp_path_inf) the snippet of the code for dmed check condition
left out, which leads to an issue of selecting incorrect bestpath.

As an example:

During the bestpath selection local route looses to another path due
to dmed condition being hit.

The snippet of the logs:

2025/02/20 03:06:20.131441 BGP: [JW7VP-K1YVV]
[2]:[0]:[48]:[00:92:00:00:00:10](VRF default): Comparing path
27.0.0.7 flags Valid  with path Static announcement flags Selected Valid Attr Changed Unsorted
2025/02/20 03:06:20.131445 BGP: [SYTDR-QV6X9] [2]:[0]:[48]:[00:92:00:00:00:10]: path 27.0.0.7 loses to path Static announcement as ES 03:44:38:39:ff:ff:02:00:00:01 is same and local
2025/02/20 03:06:20.131452 BGP: [JW7VP-K1YVV] [2]:[0]:[48]:[00:92:00:00:00:10](VRF default): Comparing path 27.0.0.8 flags Valid  with path Static announcement flags Selected Valid Attr Changed Unsorted
2025/02/20 03:06:20.131456 BGP: [SYTDR-QV6X9] [2]:[0]:[48]:[00:92:00:00:00:10]: path 27.0.0.8 loses to path Static announcement as ES 03:44:38:39:ff:ff:02:00:00:01 is same and local
2025/02/20 03:06:20.131458 BGP: [WEWEC-8SE72] [2]:[0]:[48]:[00:92:00:00:00:10](VRF default): path Static announcement is the bestpath from AS 0   <<<< static is best
2025/02/20 03:06:20.131463 BGP: [Z3A78-GM3G5] bgp_best_selection: [2]:[0]:[48]:[00:92:00:00:00:10](VRF default) pi 27.0.0.7 dmed
2025/02/20 03:06:20.131467 BGP: [Z3A78-GM3G5] bgp_best_selection: [2]:[0]:[48]:[00:92:00:00:00:10](VRF default) pi 27.0.0.8 dmed
2025/02/20 03:06:20.131471 BGP: [N6CTF-2RSKS] [2]:[0]:[48]:[00:92:00:00:00:10](VRF default): After path selection, newbest is path 27.0.0.7 oldbest was Static announce

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

2 months agoMerge pull request #18203 from FRRouting/mergify/bp/dev/10.3/pr-14227
Donald Sharp [Thu, 20 Feb 2025 21:20:09 +0000 (16:20 -0500)]
Merge pull request #18203 from FRRouting/mergify/bp/dev/10.3/pr-14227

pimd: Fix for data packet loss when FHR is LHR and RP (backport #14227)

2 months agopimd: During prefix-list update, behave as PIM_UPSTREAM_NOTJOINED state (conformance... 18207/head
Rajesh Varatharaj [Wed, 21 Jun 2023 17:59:12 +0000 (10:59 -0700)]
pimd: During prefix-list update, behave as PIM_UPSTREAM_NOTJOINED state (conformance issue)

Issue:
If there are any changes to the prefix list, we perform a re-lookup to map the correct RP for the group.
Even if the S,G entry is PIM_UPSTREAM_NOTJOINED and in FHR, In the case of IGMPv3, an S,G entry can be
created with no joins. this is not necessary.
 https://www.rfc-editor.org/rfc/rfc4601#section-4.5.7 says no op in case of NOTJOINED

Solution:
To solve this issue, Stop RP mapping when the state is NOTJOINED

Ticket: #3496931

Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
(cherry picked from commit 51f26d17da288af44a8a0e536dbe317a7e678514)

2 months agopimd: Fix for data packet loss when FHR is LHR and RP 18203/head
Rajesh Varatharaj [Thu, 17 Aug 2023 20:11:42 +0000 (13:11 -0700)]
pimd: Fix for data packet loss when FHR is LHR and RP

Topology:
A single router is acting as the First Hop Router (FHR), Last Hop Router (LHR), and RP.

RC and Issue:
When an upstream S,G is in join state, it sends a register message to the RP.
If the RP has the receiver, it sends a register stop message and switches to the shortest path.
When the register stop message is processed, it removes pimreg, moves to prune,
and starts the reg stop timer.

When the reg stop timer expires, PIM changes S,G state to Join Pending and sends out a NULL
register message to RP. RP receives it and fails to send Reg stop because SPT is not set at that point.

The problem is when the register stop timer pops and state is in Join Pending.
According to https://www.rfc-editor.org/rfc/rfc4601#section-4.4.1,
we need to put back the pimreg reg tunnel into the S,G mroute.
This causes data to be sent to the control plane and subsequently interrupts the line rate.

Fix:
If the router is FHR and RP to the group,
ignore SPT status and send out a register stop message back to the DR (in this context, the same router).

Ticket: #3506780

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
(cherry picked from commit 8280257cc99e071c205e469399f2fb41671b30eb)

2 months agoMerge pull request #18162 from louis-6wind/bgp-hidden-10.3
Donald Sharp [Wed, 19 Feb 2025 13:08:58 +0000 (08:08 -0500)]
Merge pull request #18162 from louis-6wind/bgp-hidden-10.3

bgpd: fix default instance when leaving the hidden state (backport 10.3)

2 months agoMerge pull request #18191 from FRRouting/mergify/bp/dev/10.3/pr-18082
Jafar Al-Gharaibeh [Tue, 18 Feb 2025 05:14:16 +0000 (23:14 -0600)]
Merge pull request #18191 from FRRouting/mergify/bp/dev/10.3/pr-18082

lib: nb: call child destroy CBs when YANG container is deleted (backport #18082)

2 months agolib: nb: call child destroy CBs when YANG container is deleted 18191/head
Christian Hopps [Tue, 11 Feb 2025 07:12:06 +0000 (07:12 +0000)]
lib: nb: call child destroy CBs when YANG container is deleted

Previously the code was only calling the child destroy callbacks if the target
deleted node was a non-presence container. We now add a flag to the callback
structure to instruct northbound to perform the rescursive delete for code that
wishes for this to happen.

- Fix wrong relative path lookup in keychain destroy callback

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit d03ecf4562ef3ade6b7b83bf6c683c4741f395ba)

2 months agoMerge pull request #18143 from FRRouting/mergify/bp/dev/10.3/pr-18079
Jafar Al-Gharaibeh [Mon, 17 Feb 2025 19:05:21 +0000 (13:05 -0600)]
Merge pull request #18143 from FRRouting/mergify/bp/dev/10.3/pr-18079

bgpd: Fix crash in bgp_labelpool (backport #18079)

2 months agoMerge pull request #18166 from FRRouting/mergify/bp/dev/10.3/pr-18160
Donald Sharp [Sun, 16 Feb 2025 20:50:34 +0000 (15:50 -0500)]
Merge pull request #18166 from FRRouting/mergify/bp/dev/10.3/pr-18160

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

2 months agoMerge pull request #18179 from FRRouting/mergify/bp/dev/10.3/pr-18178
Donald Sharp [Sun, 16 Feb 2025 20:50:08 +0000 (15:50 -0500)]
Merge pull request #18179 from FRRouting/mergify/bp/dev/10.3/pr-18178

isisd: Request SRv6 locator after zebra connection (backport #18178)

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

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

2 months agobgpd: fix vty output of evpn route-target AS4 18183/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 agoisisd: Request SRv6 locator after zebra connection 18179/head
Carmine Scarpitta [Sat, 15 Feb 2025 09:39:40 +0000 (10:39 +0100)]
isisd: Request SRv6 locator after zebra connection

When SRv6 is enabled and an SRv6 locator is specified in the IS-IS
configuration, IS-IS may attempt to request SRv6 locator information from
zebra before the connection is fully established. If this occurs, the
request fails with the following error:

```
2025/02/14 21:41:20 ISIS: [HR66R-TWQYD][EC 100663302] srv6_manager_get_locator: invalid zclient socket
````

As a result, IS-IS is unable to obtain the locator information,
preventing SRv6 from working.

This commit fixes the issue by ensuring IS-IS requests SRv6 locator
information once the connection with zebra is successfully established.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit f02dba19d20b0a53645a439924e736155c8de63f)

2 months agoisisd: Add helper function to request SRv6 locator information
Carmine Scarpitta [Sat, 15 Feb 2025 09:39:30 +0000 (10:39 +0100)]
isisd: Add helper function to request SRv6 locator information

This commit adds a function that iterates over all IS-IS areas and asks
the SRv6 Manager for information about the configured locators.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 0b76fb3c133951c8d1203dbe7c2e5a4e1b67dffe)

2 months agobgpd: When removing the prefix list drop the pointer 18166/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 agotests: check as number in show run 18162/head
Louis Scalbert [Fri, 14 Feb 2025 10:58:24 +0000 (11:58 +0100)]
tests: check as number in show run

Creates the default VRF instance after the other VRF instances. The
default VRF instance is created in hidden state. Check that AS number
in show run is correctly written.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 months agotests: add bgp_l3vpn_hidden topotest
Louis Scalbert [Fri, 14 Feb 2025 13:07:40 +0000 (14:07 +0100)]
tests: add bgp_l3vpn_hidden topotest

Test that leaving the hidden BGP instance state is working.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>