Commit a9305afe25 for frr
commit a9305afe255718c3735bf2621dcf117fd4e9c4ae
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Thu Oct 8 17:26:53 2026 +0200
bgpd: fix 'no segment-routing srv6' leaves 'no srv6-only'
When the 'no segment-routing srv6' command is applied on a BGP instance,
the 'no srv6-only' command appears in the running configuration of that
instance, whereas it was never configured. The bgp_srv6l3vpn_sid
topotest shows the issue.
srv6-only is enabled by default on a BGP instance, but the
'no segment-routing srv6' command disables it, instead of restoring the
default value.
Fix this by enabling srv6-only when 'no segment-routing srv6' is applied.
Fixes: 4271530dff30 ("bgpd: fix srv6-only command defaulted when 'no segment-routing ipv6'")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 4ae929a591..8480443c36 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -11986,8 +11986,8 @@ DEFUN (no_bgp_segment_routing_srv6,
bgp_segment_routing_srv6_hencaps_refresh(bgp);
}
- if (bgp->srv6_only)
- bgp_srv6_only_change(bgp, false);
+ if (!bgp->srv6_only)
+ bgp_srv6_only_change(bgp, true);
return CMD_SUCCESS;
}