From e5aee1518aae56402fa73d4ce7621fb6d9f34be0 Mon Sep 17 00:00:00 2001 From: Trey Aspelund Date: Thu, 8 Apr 2021 07:25:22 +0000 Subject: [PATCH] bgpd: always allow no advertise-svi-ip/default-gw 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 --- bgpd/bgp_evpn_vty.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index 381e6f082b..ed8a6a9506 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -3452,12 +3452,6 @@ DEFUN (no_bgp_evpn_advertise_default_gw, 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; @@ -3718,16 +3712,16 @@ DEFPY(bgp_evpn_advertise_svi_ip, 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; } -- 2.39.5