]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: always allow no advertise-svi-ip/default-gw 8424/head
authorTrey Aspelund <taspelund@nvidia.com>
Thu, 8 Apr 2021 07:25:22 +0000 (07:25 +0000)
committerTrey Aspelund <taspelund@nvidia.com>
Thu, 8 Apr 2021 07:25:22 +0000 (07:25 +0000)
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>
bgpd/bgp_evpn_vty.c

index 381e6f082bab0916e88d809116f8a6591637ff0a..ed8a6a9506001b3c15527ad20beb72cb3632da62 100644 (file)
@@ -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;
 }