Commit 4aaf4fd407 for frr
commit 4aaf4fd40744dfbd1bee41a3ac6f50eca8977d7e
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Wed Oct 21 15:45:37 2026 +0200
bgpd: fix neighbor encapsulation-srv6 applied again
When the configuration of a BGP instance is applied again, for instance
by 'vtysh -f /etc/frr/frr.conf' after a daemon restart, the
'neighbor encapsulation-srv6' and 'neighbor encapsulation-srv6-relax'
commands fail, although the configuration does not change:
> % Peer is already configured, unset it first.
> line 58: Failure to communicate[13] to bgpd, line: neighbor fd00:0:0:2::2 encapsulation-srv6-relax
> % Peer is already configured, unset it first.
> line 59: Failure to communicate[13] to bgpd, line: neighbor fd00:0:0:3::2 encapsulation-srv6
The command refuses any encapsulation flag when one of them is already
set on the peer, including the flag that is requested.
Fix this by accepting the command without change when the requested flag
is already set. Setting the other flag still fails.
Fixes: 0e1ec43c5802 ("bgpd: announce bgp srv6 unicast")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 343b1b12e3..61e5cb942f 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -10503,6 +10503,9 @@ DEFPY(neighbor_encap_srv6,
return ret;
}
+ if (peergroup_af_flag_check(peer, afi, safi, flag))
+ return CMD_SUCCESS;
+
if (peergroup_af_flag_check(peer, afi, safi, PEER_FLAG_CONFIG_ENCAPSULATION_SRV6) ||
peergroup_af_flag_check(peer, afi, safi, PEER_FLAG_CONFIG_ENCAPSULATION_SRV6_RELAX)) {
vty_out(vty, "%% Peer is already configured, unset it first.\n");