Current behavior has an EVPN_ENABLED check for both standard and 'no'
forms of 'advertise-svi-ip' and 'advertise-default-gw'. This prevents a
user from removing either command from running config if
'advertise-all-vni' is not present.
This commit removes/adjusts the EVPN_ENABLED checks to always allow the
'no' command so config doesn't get stuck.
Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
if (!bgp)
return CMD_WARNING;
- if (!EVPN_ENABLED(bgp)) {
- vty_out(vty,
- "This command is only supported under the EVPN VRF\n");
- return CMD_WARNING;
- }
-
evpn_unset_advertise_default_gw(bgp, NULL);
return CMD_SUCCESS;
if (!bgp)
return CMD_WARNING;
- if (!EVPN_ENABLED(bgp)) {
- vty_out(vty,
- "This command is only supported under EVPN VRF\n");
- return CMD_WARNING;
- }
-
if (no)
evpn_set_advertise_svi_macip(bgp, NULL, 0);
- else
+ else {
+ if (!EVPN_ENABLED(bgp)) {
+ vty_out(vty,
+ "This command is only supported under EVPN VRF\n");
+ return CMD_WARNING;
+ }
evpn_set_advertise_svi_macip(bgp, NULL, 1);
+ }
return CMD_SUCCESS;
}