Commit c3f8433e62 for frr
commit c3f8433e62beadf36a9545752c184930eeeaf55e
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Fri Aug 28 17:24:45 2026 +0200
bgpd: update the rx vrf updates when srv6-only of default bgp instance
The incoming vrf updates were not refreshed when srv6-only command was
changed on the default BGP instance. In that case, a refresh of all the
VRF instances should be done.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 3a46a8e264..593aa5c8f0 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -11879,13 +11879,38 @@ static void bgp_segment_routing_srv6_hencaps_refresh(struct bgp *bgp)
static void bgp_srv6_only_change(struct bgp *bgp, bool enable)
{
+ struct bgp *bgp_inst;
+ struct listnode *node;
+
/* pre-change */
+ if (bgp == bgp_get_default()) {
+ /* srv6-only changed on default BGP instance, refresh importation to vrf */
+ for (ALL_LIST_ELEMENTS_RO(bm->bgp, node, bgp_inst)) {
+ if (bgp_inst->inst_type == BGP_INSTANCE_TYPE_VIEW)
+ continue;
+ vpn_leak_prechange(BGP_VPN_POLICY_DIR_FROMVPN, AFI_IP, bgp_get_default(),
+ bgp_inst);
+ vpn_leak_prechange(BGP_VPN_POLICY_DIR_FROMVPN, AFI_IP6, bgp_get_default(),
+ bgp_inst);
+ }
+ }
vpn_leak_prechange(BGP_VPN_POLICY_DIR_TOVPN, AFI_IP, bgp_get_default(), bgp);
vpn_leak_prechange(BGP_VPN_POLICY_DIR_TOVPN, AFI_IP6, bgp_get_default(), bgp);
bgp->srv6_only = enable;
/* post-change */
+ if (bgp_get_default() == bgp) {
+ /* srv6-only changed on default BGP instance, refresh importation to vrf */
+ for (ALL_LIST_ELEMENTS_RO(bm->bgp, node, bgp_inst)) {
+ if (bgp_inst->inst_type == BGP_INSTANCE_TYPE_VIEW)
+ continue;
+ vpn_leak_postchange(BGP_VPN_POLICY_DIR_FROMVPN, AFI_IP, bgp_get_default(),
+ bgp_inst);
+ vpn_leak_postchange(BGP_VPN_POLICY_DIR_FROMVPN, AFI_IP6, bgp_get_default(),
+ bgp_inst);
+ }
+ }
vpn_leak_postchange(BGP_VPN_POLICY_DIR_TOVPN, AFI_IP, bgp_get_default(), bgp);
vpn_leak_postchange(BGP_VPN_POLICY_DIR_TOVPN, AFI_IP6, bgp_get_default(), bgp);
}
diff --git a/tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py b/tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py
index 83be4d7dfe..7eaa5dc1f0 100755
--- a/tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py
+++ b/tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py
@@ -764,9 +764,6 @@ def test_sid_add_peer_no_srv6_only():
"""
)
- logger.info("On r2, flush BGP sessions to force re-run best path over 2001:8::/64")
- get_topogen().gears["r2"].vtysh_cmd("clear bgp ipv6 vpn *")
-
logger.info("On r2, check that the MPLS prefix 2001:8::/64 is selected in vrf20")
check_rib(
"r2",