]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: fix optional distance on static mrib route
authorDavid Lamparter <equinox@opensourcerouting.org>
Thu, 22 Jan 2015 18:03:53 +0000 (19:03 +0100)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:31 +0000 (20:38 -0400)
Unfortunately, the quagga CLI parser doesn't support [<1-255>].  Fix by
working around with an alias.

Replaces the following commits:
- zebra: mrib: [no] ip mroute - require distance.
- zebra: mrib: [no] ip mroute - make distance optional.
(Rewritten as alias)

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra/zebra_vty.c

index 14025e7f3a014a4263fc19532271128067c305e5..597476296d78345c466b791d2086206fd56e5750 100644 (file)
@@ -167,9 +167,9 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd,
 }
 
 /* Static unicast routes for multicast RPF lookup. */
-DEFUN (ip_mroute,
-       ip_mroute_cmd,
-       "ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) [<1-255>]",
+DEFUN (ip_mroute_dist,
+       ip_mroute_dist_cmd,
+       "ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) <1-255>",
        IP_STR
        "Configure static unicast route into MRIB for multicast RPF lookup\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -177,12 +177,21 @@ DEFUN (ip_mroute,
        "Nexthop interface name\n"
        "Distance\n")
 {
-  return zebra_static_ipv4 (vty, SAFI_MULTICAST, 1, argv[0], NULL, argv[1], NULL, NULL, argv[2], NULL);
+    return zebra_static_ipv4 (vty, SAFI_MULTICAST, 1, argv[0], NULL, argv[1], NULL, NULL, argc > 2 ? argv[2] : NULL, NULL);
 }
 
-DEFUN (no_ip_mroute,
-       no_ip_mroute_cmd,
-       "no ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) [<1-255>]",
+ALIAS (ip_mroute_dist,
+       ip_mroute_cmd,
+       "ip mroute A.B.C.D/M (A.B.C.D|INTERFACE)",
+       IP_STR
+       "Configure static unicast route into MRIB for multicast RPF lookup\n"
+       "IP destination prefix (e.g. 10.0.0.0/8)\n"
+       "Nexthop address\n"
+       "Nexthop interface name\n")
+
+DEFUN (no_ip_mroute_dist,
+       no_ip_mroute_dist_cmd,
+       "no ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) <1-255>",
        IP_STR
        "Configure static unicast route into MRIB for multicast RPF lookup\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -190,9 +199,19 @@ DEFUN (no_ip_mroute,
        "Nexthop interface name\n"
        "Distance\n")
 {
-  return zebra_static_ipv4 (vty, SAFI_MULTICAST, 0, argv[0], NULL, argv[1], NULL, NULL, argv[2], NULL);
+    return zebra_static_ipv4 (vty, SAFI_MULTICAST, 0, argv[0], NULL, argv[1], NULL, NULL, argc > 2 ? argv[2] : NULL, NULL);
 }
 
+ALIAS (no_ip_mroute_dist,
+       no_ip_mroute_cmd,
+       "no ip mroute A.B.C.D/M (A.B.C.D|INTERFACE)",
+       NO_STR
+       IP_STR
+       "Configure static unicast route into MRIB for multicast RPF lookup\n"
+       "IP destination prefix (e.g. 10.0.0.0/8)\n"
+       "Nexthop address\n"
+       "Nexthop interface name\n")
+
 DEFUN (show_ip_rpf,
        show_ip_rpf_cmd,
        "show ip rpf",
@@ -5827,7 +5846,9 @@ zebra_vty_init (void)
   install_element (CONFIG_NODE, &allow_external_route_update_cmd);
   install_element (CONFIG_NODE, &no_allow_external_route_update_cmd);
   install_element (CONFIG_NODE, &ip_mroute_cmd);
+  install_element (CONFIG_NODE, &ip_mroute_dist_cmd);
   install_element (CONFIG_NODE, &no_ip_mroute_cmd);
+  install_element (CONFIG_NODE, &no_ip_mroute_dist_cmd);
   install_element (CONFIG_NODE, &ip_route_cmd);
   install_element (CONFIG_NODE, &ip_route_tag_cmd);
   install_element (CONFIG_NODE, &ip_route_flags_cmd);