]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: vni [prefix-routes-only] should also be provided for the 'no' cmd
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Tue, 10 Apr 2018 08:37:21 +0000 (01:37 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 May 2018 23:24:15 +0000 (19:24 -0400)
We have a command to enable symmetric routing only for type-5 routes.
This command is provided under vrf <> option in zebra as follows:
vrf <VRF>
  vni <VNI> [prefix-routes-only]
We need the corresponding no version of the command as well as follows:
vrf <VRF>
  no vni <VNI> [prefix-routes-only]

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
zebra/zebra_vty.c
zebra/zebra_vxlan.c

index 2ae9ac5082969bb370ac7686ea69bdbb847db993..e6f80f92a7ddb08a9f17958ccb4b19e6b9029fef 100644 (file)
@@ -2798,12 +2798,14 @@ DEFUN (vrf_vni_mapping,
 
 DEFUN (no_vrf_vni_mapping,
        no_vrf_vni_mapping_cmd,
-       "no vni " CMD_VNI_RANGE,
+       "no vni " CMD_VNI_RANGE "[prefix-routes-only]",
        NO_STR
        "VNI corresponding to tenant VRF\n"
-       "VNI-ID")
+       "VNI-ID\n"
+       "prefix-routes-only\n")
 {
        int ret = 0;
+       int filter = 0;
        char err[ERR_STR_SZ];
        vni_t vni = strtoul(argv[2]->arg, NULL, 10);
 
@@ -2812,7 +2814,11 @@ DEFUN (no_vrf_vni_mapping,
        assert(vrf);
        assert(zvrf);
 
-       ret = zebra_vxlan_process_vrf_vni_cmd(zvrf, vni, err, ERR_STR_SZ, 0, 0);
+       if (argc == 4)
+               filter = 1;
+
+       ret = zebra_vxlan_process_vrf_vni_cmd(zvrf, vni, err,
+                                             ERR_STR_SZ, filter, 0);
        if (ret != 0) {
                vty_out(vty, "%s\n", err);
                return CMD_WARNING;
index 6f3b5d26a17a740cf364fce0b374fce75e6ee483..83c241632d8e6ef80b16d2aaeb7053f09c9f21ae 100644 (file)
@@ -6531,6 +6531,12 @@ int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf, vni_t vni,
                        return -1;
                }
 
+               if (filter && !CHECK_FLAG(zl3vni->filter, PREFIX_ROUTES_ONLY)) {
+                       snprintf(err, ERR_STR_SZ,
+                                "prefix-routes-only is not set for the vni");
+                       return -1;
+               }
+
                zebra_vxlan_process_l3vni_oper_down(zl3vni);
 
                /* delete and uninstall all rmacs */