Skip to content

Commit 54bf58f

Browse files
committed
bgpd: fix allow to reconfigure advertise-all-vni on non default vrf
When running 'no advertise-all-vni' command on the evpn bgp instance, then reconfiguring it is not possible: > r2(config)# router bgp 65000 vrf vrf-evpn > r2(config-router)# address-family l2vpn evpn > r2(config-router-af)# > r2(config-router-af)# no advertise-all-vni > r2(config-router-af)# advertise-all-vni > % Please unconfigure EVPN in VRF default > r2(config-router-af)# Actually, the evpn bgp instance is not the default one. Fix this by not setting the bgp evpn instance to the default BGP instance, when removing the 'advertise-all-vni' command. Fixes: e2f3a93 ("bgpd: Allow non-default instance to be EVPN one") Signed-off-by: Philippe Guibert <[email protected]>
1 parent e61652d commit 54bf58f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bgpd/bgp_evpn_vty.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3516,7 +3516,7 @@ static void evpn_set_advertise_all_vni(struct bgp *bgp)
35163516
static void evpn_unset_advertise_all_vni(struct bgp *bgp)
35173517
{
35183518
bgp->advertise_all_vni = 0;
3519-
bgp_set_evpn(bgp_get_default());
3519+
bgp_set_evpn(NULL);
35203520
bgp_zebra_advertise_all_vni(bgp, bgp->advertise_all_vni);
35213521
bgp_evpn_cleanup_on_disable(bgp);
35223522
}
@@ -3739,9 +3739,14 @@ DEFUN (no_bgp_evpn_advertise_all_vni,
37393739
"Advertise All local VNIs\n")
37403740
{
37413741
struct bgp *bgp = VTY_GET_CONTEXT(bgp);
3742+
struct bgp *bgp_evpn = NULL;
37423743

37433744
if (!bgp)
37443745
return CMD_WARNING;
3746+
bgp_evpn = bgp_get_evpn();
3747+
if (!bgp_evpn || bgp_evpn != bgp)
3748+
return CMD_SUCCESS;
3749+
37453750
evpn_unset_advertise_all_vni(bgp);
37463751
return CMD_SUCCESS;
37473752
}

0 commit comments

Comments
 (0)