Commit Graph

38054 Commits

Author SHA1 Message Date
Louis Scalbert
cec0da3d9b 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 71a3756f2d)
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-27 09:43:55 +01:00
Louis Scalbert
64dba6b488 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 d2ff7e8a21)
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-27 09:43:55 +01:00
Donald Sharp
5bbf45dc56
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)
2025-02-26 11:15:31 -05:00
Donald Sharp
308daf81ca
Merge pull request #18255 from Jafaral/no-bgp-hidden
Revert "bgpd: fix default instance when leaving the hidden state (backport 10.3)" #18162
2025-02-26 08:24:51 -05:00
Russ White
45a67326ac
Merge pull request #18227 from FRRouting/mergify/bp/dev/10.3/pr-18210
bgpd: remove dmed check not required in bestpath selection (backport #18210)
2025-02-25 10:40:48 -05:00
Donald Sharp
abae4012a7
Merge pull request #18232 from FRRouting/mergify/bp/dev/10.3/pr-18231
Fix oper-state queries that involve choice/case nodes (backport #18231)
2025-02-25 10:38:16 -05:00
Donald Sharp
19f9e46c81
Merge pull request #18244 from FRRouting/mergify/bp/dev/10.3/pr-18225
pim: Fix autorp group joins (backport #18225)
2025-02-25 10:37:55 -05:00
Donald Sharp
f8276261bf
Merge pull request #18246 from FRRouting/mergify/bp/dev/10.3/pr-18226
pim: Fix vrf binding of autorp and mroute socket (backport #18226)
2025-02-25 10:37:12 -05:00
Donald Sharp
f25a650899
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)
2025-02-25 10:36:56 -05:00
Jafar Al-Gharaibeh
c2ecbdccc5 Revert "bgpd: fix default instance name when un-hiding"
This reverts commit 20664936af.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-02-25 08:58:38 -06:00
Jafar Al-Gharaibeh
094363f8bd Revert "bgpd: fix process_queue when un-hiding"
This reverts commit a2c1956efa.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-02-25 08:58:34 -06:00
Jafar Al-Gharaibeh
bc6c7f60dc Reapply "bgpd: fix bgp vrf instance creation from implicit"
This reverts commit d9d74d33bc.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-02-25 08:58:14 -06:00
Jafar Al-Gharaibeh
21ffe63d1d Revert "bgpd: update AS value of a hidden bgp instance"
This reverts commit 8e04277fff.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-02-25 08:57:57 -06:00
Jafar Al-Gharaibeh
4156757e40 Revert "tests: add bgp_l3vpn_hidden topotest"
This reverts commit bb79a6562f.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-02-25 08:57:48 -06:00
Jafar Al-Gharaibeh
e209f5bf68 Revert "tests: check as number in show run"
This reverts commit 85c5598bb9.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-02-25 08:57:22 -06:00
Martin Buck
d2e92ea75a pimd: Fix PIM VRF support (send register/register stop in VRF)
In 9461953914 and
8ebcc02328, 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 5a01011e0d)
2025-02-24 18:57:31 +00:00
Nathan Bahr
76e4076d26 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 7e181a771c)
2025-02-24 18:55:16 +00:00
Nathan Bahr
673410bd30 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 d840560b74)
2025-02-24 18:54:09 +00:00
Christian Hopps
4247bc5693 tests: add unit-test for choice/case node queries
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 73df7da40a)
2025-02-22 20:07:56 +00:00
Christian Hopps
720be891cc lib: nb: fix oper-state queries that involve choice/case nodes
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit b9ff10b086)
2025-02-22 20:07:56 +00:00
Donald Sharp
d9712eb382 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 83ad94694b)
2025-02-21 23:12:20 +00:00
Donald Sharp
24dbcbb31e
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)
2025-02-20 16:20:09 -05:00
Rajesh Varatharaj
83fb10210f 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 51f26d17da)
2025-02-20 18:41:52 +00:00
Rajesh Varatharaj
02de49a3b2 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 8280257cc9)
2025-02-20 16:57:15 +00:00
Donald Sharp
211df1f649
Merge pull request #18162 from louis-6wind/bgp-hidden-10.3
bgpd: fix default instance when leaving the hidden state (backport 10.3)
2025-02-19 08:08:58 -05:00
Jafar Al-Gharaibeh
9a729a2fa3
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)
2025-02-17 23:14:16 -06:00
Christian Hopps
3c08c6fe28 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 d03ecf4562)
2025-02-18 02:37:45 +00:00
Jafar Al-Gharaibeh
33ed0a3315
Merge pull request #18143 from FRRouting/mergify/bp/dev/10.3/pr-18079
bgpd: Fix crash in bgp_labelpool (backport #18079)
2025-02-17 13:05:21 -06:00
Donald Sharp
bb22e8b24b
Merge pull request #18166 from FRRouting/mergify/bp/dev/10.3/pr-18160
bgpd: When removing the prefix list drop the pointer (backport #18160)
2025-02-16 15:50:34 -05:00
Donald Sharp
f432c7b5b5
Merge pull request #18179 from FRRouting/mergify/bp/dev/10.3/pr-18178
isisd: Request SRv6 locator after zebra connection (backport #18178)
2025-02-16 15:50:08 -05:00
Donald Sharp
ea9fc3e7f8
Merge pull request #18183 from FRRouting/mergify/bp/dev/10.3/pr-18109
bgpd: fix vty output of evpn route-target AS4 (backport #18109)
2025-02-16 08:10:09 -05:00
Mark Stapp
ec023e084f 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 9943a08720)
2025-02-15 20:11:56 +00:00
Carmine Scarpitta
c4ef0e37ef 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 f02dba19d2)
2025-02-15 14:40:39 +00:00
Carmine Scarpitta
5de0b8dc9d 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 0b76fb3c13)
2025-02-15 14:40:39 +00:00
Donald Sharp
72594acc31 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 3d43d7b789)
2025-02-14 21:29:01 +00:00
Louis Scalbert
85c5598bb9 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>
2025-02-14 18:08:53 +01:00
Louis Scalbert
bb79a6562f 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>
2025-02-14 18:08:53 +01:00
Alexander Skorichenko
8e04277fff 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>
2025-02-14 18:08:53 +01:00
Louis Scalbert
d9d74d33bc Revert "bgpd: fix bgp vrf instance creation from implicit"
This reverts commit 2ff08af78e.

The fix is obviously wrong.

Link: 2ff08af78e
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-14 18:08:53 +01:00
Louis Scalbert
a2c1956efa 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>
2025-02-14 18:08:53 +01:00
Louis Scalbert
20664936af 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>
2025-02-14 18:08:53 +01:00
Jafar Al-Gharaibeh
6cfea1aa87
Merge pull request #18146 from FRRouting/mergify/bp/dev/10.3/pr-18023
lib: fix false context information for SRv6 route (backport #18023)
2025-02-13 19:04:18 -06:00
Jafar Al-Gharaibeh
478864436d
Merge pull request #18151 from FRRouting/mergify/bp/dev/10.3/pr-18064
staticd: Fix SRv6 SID installation and deletion (backport #18064)
2025-02-13 19:03:50 -06:00
Donald Sharp
961a9528ec
Merge pull request #18154 from FRRouting/mergify/bp/dev/10.3/pr-18121
bgpd: release manual vpn label on instance deletion (backport #18121)
2025-02-13 17:44:20 -05:00
Louis Scalbert
6a72facbdc 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 d6363625c3)
2025-02-13 19:09:09 +00:00
Carmine Scarpitta
92fa579d04 tests: Extend SRv6 static SIDs topotest to verify SID structure
The `static_srv6_sids` topotest verifies that staticd correctly
programs the SIDs in the zebra RIB. Currently, the topotest only
validates the programmed behavior and SID attributes.

This commit extends the topotest to also validate the SID structure.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit a6d02fe2fb)
2025-02-13 18:38:17 +00:00
Carmine Scarpitta
2a23344123 lib: Add sidStructure in SRv6 SIDs JSON output
The `show ipv6 route json` command displays the IPv6 routing table in
JSON format, including SRv6 SIDs. For each SRv6 SID, it provides
behavior and SID attributes. However, it does not include the SID
structure.

This commit adds the SID structure to the SRv6 SID JSON output.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 312f7b3f8c)
2025-02-13 18:38:17 +00:00
Carmine Scarpitta
fce911649b staticd: Fix SRv6 SID installation and deletion
The SRv6 support in staticd (PR #16894) does not set the correct SID
parameters (block length, node length, function length).

This commit fixes the issue and computes the correct parameters.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit e1654ba554)
2025-02-13 18:38:16 +00:00
Philippe Guibert
1f0845ad29 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: e496b42030 ("bgpd: prefix-sid srv6 l3vpn service tlv")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 658bf0281d)
2025-02-13 17:58:27 +00:00
Donald Sharp
ba721ac7f7 bgpd: Fix crash in bgp_labelpool
The bgp labelpool code is grabbing the vpn policy data structure.
This vpn_policy has a pointer to the bgp data structure.  If
a item placed on the bgp label pool workqueue happens to sit
there for the microsecond or so and the operator issues a
`no router bgp...` command that corresponds to the vpn_policy
bgp pointer, when the workqueue is run it will crash because
the bgp pointer is now freed and something else owns it.

Modify the labelpool code to store the vrf id associated
with the request on the workqueue.  When you wake up
if the vrf id still has a bgp pointer allow the request
to continue, else drop it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 14eac319e8)
2025-02-13 17:45:10 +00:00