summaryrefslogtreecommitdiff
path: root/zebra/zebra_vty.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-11-22 15:45:41 -0500
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-11-28 14:12:07 -0500
commit10c61d28bfd3728236c08095c3aebb51b480b0e9 (patch)
treec582090f8d64a9aac74993e2fe0c711c2e21cdea /zebra/zebra_vty.c
parentfcaae8e4ec680ad1b5d73d7ee2d30c5974192491 (diff)
zebra: add back support for nUlL0
Re-add support for typos when specifying a null route. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r--zebra/zebra_vty.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 43895378cd..c2c7075671 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -351,7 +351,7 @@ DEFPY(ip_route_blackhole,
ip_route_blackhole_cmd,
"[no] ip route\
<A.B.C.D/M$prefix|A.B.C.D$prefix A.B.C.D$mask> \
- <Null0|reject|blackhole>$flag \
+ <reject|blackhole>$flag \
[{ \
tag (1-4294967295) \
|(1-255)$distance \
@@ -363,7 +363,6 @@ DEFPY(ip_route_blackhole,
"IP destination prefix (e.g. 10.0.0.0/8)\n"
"IP destination prefix\n"
"IP destination prefix mask\n"
- "Null interface\n"
"Emit an ICMP unreachable when matched\n"
"Silently discard pkts when matched\n"
"Set tag for this route\n"
@@ -395,15 +394,21 @@ DEFPY(ip_route_address_interface,
"IP destination prefix\n"
"IP destination prefix mask\n"
"IP gateway address\n"
- "IP gateway interface name\n"
+ "IP gateway interface name. Specify 'Null0' (case-insensitive) for a \
+ null route.\n"
"Set tag for this route\n"
"Tag value\n"
"Distance value for this route\n"
VRF_CMD_HELP_STR
MPLS_LABEL_HELPSTR)
{
+ const char *flag = NULL;
+ if (ifname && !strncasecmp(ifname, "Null0", 5)) {
+ flag = "Null0";
+ ifname = NULL;
+ }
return zebra_static_route(vty, AFI_IP, SAFI_UNICAST, no, prefix,
- mask_str, NULL, gate_str, ifname, NULL,
+ mask_str, NULL, gate_str, ifname, flag,
tag_str, distance_str, vrf, label);
}
@@ -431,8 +436,13 @@ DEFPY(ip_route,
VRF_CMD_HELP_STR
MPLS_LABEL_HELPSTR)
{
+ const char *flag = NULL;
+ if (ifname && !strncasecmp(ifname, "Null0", 5)) {
+ flag = "Null0";
+ ifname = NULL;
+ }
return zebra_static_route(vty, AFI_IP, SAFI_UNICAST, no, prefix,
- mask_str, NULL, gate_str, ifname, NULL,
+ mask_str, NULL, gate_str, ifname, flag,
tag_str, distance_str, vrf, label);
}