Commit 0199e869c1 for frr
commit 0199e869c18c84d63c536cfa2e66d39bcc98b568
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Tue Nov 3 10:18:30 2026 +0100
bgpd: refuse SRv6 unicast SIDs in a BGP view
The SRv6 unicast SIDs ('sid export' in the unicast address-families)
are only supported in the default BGP instance, but the following
configuration of a BGP view is accepted, and kept in the running
configuration:
> router bgp 65100 view v1
> address-family ipv4 unicast
> sid export auto
The 'sid export' command checks that the instance is in the default
VRF. A view is in the default VRF too: its SID requests use the same
context as the ones of the default instance, and the SID notifications
of zebra are given to the first BGP instance found in this VRF.
Fix this by checking that the instance is the default BGP instance.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 343b1b12e3..f54ecaa059 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -10533,8 +10533,8 @@ DEFPY(sid_export,
struct in6_addr *unicast_sid_explicit = NULL;
VTY_DECLVAR_CONTEXT(bgp, bgp);
- if (bgp->vrf_id != VRF_DEFAULT) {
- vty_out(vty, "SRv6 unicast is only supported on default vrf");
+ if (bgp->inst_type != BGP_INSTANCE_TYPE_DEFAULT) {
+ vty_out(vty, "SRv6 unicast is only supported on the default BGP instance\n");
return CMD_WARNING_CONFIG_FAILED;
}