summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-10-21 16:05:03 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-10-21 16:05:03 -0400
commit882261e18b9632092d2e7f226f68e2a1c54a7241 (patch)
treeea0ddd6d95606b07a4b84a6cda03f2ab31463b54
parentaac9ef6cb0169ea96debe2872066021608631c16 (diff)
parent36602be128d4f4e49c19555a194430b9691c9a30 (diff)
Merge remote-tracking branch 'origin/cmaster' into cmaster-next
-rw-r--r--bgpd/bgp_network.c5
-rw-r--r--bgpd/bgp_route.c62
-rw-r--r--ospfd/ospf_vty.c2
-rw-r--r--zebra/kernel_netlink.c3
-rw-r--r--zebra/zebra_static.c6
-rw-r--r--zebra/zebra_static.h2
-rw-r--r--zebra/zebra_vty.c131
7 files changed, 119 insertions, 92 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index 65e2aeaf4e..c528fcdcde 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -333,8 +333,9 @@ bgp_accept (struct thread *thread)
/* Obtain BGP instance this connection is meant for. */
if (bgp_get_instance_for_inc_conn (bgp_sock, &bgp))
{
- zlog_err ("[Error] Could not get instance for incoming conn from %s",
- inet_sutop (&su, buf));
+ if (bgp_debug_neighbor_events(NULL))
+ zlog_debug ("[Event] Could not get instance for incoming conn from %s",
+ inet_sutop (&su, buf));
close (bgp_sock);
return -1;
}
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index e28aa715f9..d7fcf5b457 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -7588,9 +7588,8 @@ bgp_show_prefix_longer (struct vty *vty, const char *name,
safi_t safi, enum bgp_show_type type);
static int
-bgp_show_table (struct vty *vty, struct bgp_table *table,
- struct in_addr *router_id, enum bgp_show_type type,
- void *output_arg, u_char use_json, json_object *json)
+bgp_show_table (struct vty *vty, struct bgp *bgp, struct bgp_table *table,
+ enum bgp_show_type type, void *output_arg, u_char use_json)
{
struct bgp_info *ri;
struct bgp_node *rn;
@@ -7602,16 +7601,15 @@ bgp_show_table (struct vty *vty, struct bgp_table *table,
char buf[BUFSIZ];
char buf2[BUFSIZ];
json_object *json_paths = NULL;
- json_object *json_routes = NULL;
+ int first = 1;
if (use_json)
{
- if (json == NULL)
- json = json_object_new_object();
-
- json_object_int_add(json, "tableVersion", table->version);
- json_object_string_add(json, "routerId", inet_ntoa (*router_id));
- json_routes = json_object_new_object();
+ vty_out (vty, "{ \"vrfId\": %d, \"vrfName\": \"%s\", \"tableVersion\": %" PRId64 ", \"routerId\": \"%s\", \"routes\": { ",
+ bgp->vrf_id == VRF_UNKNOWN ? -1 : bgp->vrf_id,
+ bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT ? "Default" : bgp->name,
+ table->version, inet_ntoa (bgp->router_id));
+ json_paths = json_object_new_object();
}
/* This is first entry point, so reset total line. */
@@ -7623,7 +7621,10 @@ bgp_show_table (struct vty *vty, struct bgp_table *table,
if (rn->info != NULL)
{
display = 0;
-
+ if (!first && use_json)
+ {
+ vty_out (vty, ",");
+ }
if (use_json)
json_paths = json_object_new_array();
else
@@ -7778,7 +7779,7 @@ bgp_show_table (struct vty *vty, struct bgp_table *table,
if (!use_json && header)
{
- vty_out (vty, "BGP table version is %" PRIu64 ", local router ID is %s%s", table->version, inet_ntoa (*router_id), VTY_NEWLINE);
+ vty_out (vty, "BGP table version is %" PRIu64 ", local router ID is %s%s", table->version, inet_ntoa (bgp->router_id), VTY_NEWLINE);
vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE);
vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE);
if (type == bgp_show_type_dampend_paths
@@ -7826,19 +7827,19 @@ bgp_show_table (struct vty *vty, struct bgp_table *table,
{
p = &rn->p;
sprintf(buf2, "%s/%d", inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), p->prefixlen);
- json_object_object_add(json_routes, buf2, json_paths);
+ vty_out (vty, "\"%s\": ", buf2);
+ vty_out (vty, "%s", json_object_to_json_string (json_paths));
+ json_object_free (json_paths);
+ first = 0;
+
}
}
}
if (use_json)
{
- /* This can produce a LOT of text so do not use
- * JSON_C_TO_STRING_PRETTY here
- */
- json_object_object_add(json, "routes", json_routes);
- vty_out (vty, "%s%s", json_object_to_json_string(json), VTY_NEWLINE);
- json_object_free(json);
+ json_object_free (json_paths);
+ vty_out (vty, " } }%s", VTY_NEWLINE);
}
else
{
@@ -7876,8 +7877,8 @@ bgp_show (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
table = bgp->rib[afi][safi];
- return bgp_show_table (vty, table, &bgp->router_id, type, output_arg,
- use_json, NULL);
+ return bgp_show_table (vty, bgp, table, type, output_arg,
+ use_json);
}
static void
@@ -7887,7 +7888,6 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi,
struct listnode *node, *nnode;
struct bgp *bgp;
struct bgp_table *table;
- json_object *json = NULL;
int is_first = 1;
if (use_json)
@@ -7897,20 +7897,6 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi,
{
if (use_json)
{
- if (!(json = json_object_new_object()))
- {
- zlog_err("Unable to allocate memory for JSON object");
- vty_out (vty,
- "{\"error\": {\"message:\": \"Unable to allocate memory for JSON object\"}}}%s",
- VTY_NEWLINE);
- return;
- }
- json_object_int_add(json, "vrfId",
- (bgp->vrf_id == VRF_UNKNOWN)
- ? -1 : bgp->vrf_id);
- json_object_string_add(json, "vrfName",
- (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
- ? "Default" : bgp->name);
if (! is_first)
vty_out (vty, ",%s", VTY_NEWLINE);
else
@@ -7928,8 +7914,8 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi,
VTY_NEWLINE);
}
table = bgp->rib[afi][safi];
- bgp_show_table (vty, table, &bgp->router_id,
- bgp_show_type_normal, NULL, use_json, json);
+ bgp_show_table (vty, bgp, table,
+ bgp_show_type_normal, NULL, use_json);
}
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index dbda2bc757..b0946600ba 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -4880,7 +4880,7 @@ show_ip_ospf_neighbor_detail_all_common (struct vty *vty, struct ospf *ospf, u_c
for (rn = route_top (oi->nbrs); rn; rn = route_next (rn))
if ((nbr = rn->info))
if (nbr != oi->nbr_self)
- if (oi->type == OSPF_IFTYPE_NBMA && nbr->state != NSM_Down)
+ if (nbr->state != NSM_Down)
show_ip_ospf_neighbor_detail_sub (vty, oi, rn->info, use_json, json);
if (oi->type == OSPF_IFTYPE_NBMA)
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c
index ef7a891693..378327ab46 100644
--- a/zebra/kernel_netlink.c
+++ b/zebra/kernel_netlink.c
@@ -509,7 +509,8 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *,
if (nl == &zns->netlink_cmd
&& ((msg_type == RTM_DELROUTE &&
(-errnum == ENODEV || -errnum == ESRCH))
- || (msg_type == RTM_NEWROUTE && -errnum == EEXIST)))
+ || (msg_type == RTM_NEWROUTE &&
+ (-errnum == ENETDOWN || -errnum == EEXIST))))
{
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug ("%s: error: %s type=%s(%u), seq=%u, pid=%u",
diff --git a/zebra/zebra_static.c b/zebra/zebra_static.c
index a691048b2c..298fc4e09d 100644
--- a/zebra/zebra_static.c
+++ b/zebra/zebra_static.c
@@ -81,7 +81,7 @@ static_install_route (afi_t afi, safi_t safi, struct prefix *p, struct static_ro
case STATIC_IFINDEX:
nexthop = rib_nexthop_ifindex_add (rib, si->ifindex);
break;
- case STATIC_IPV4_BLACKHOLE:
+ case STATIC_BLACKHOLE:
nexthop = rib_nexthop_blackhole_add (rib);
break;
case STATIC_IPV6_GATEWAY:
@@ -145,7 +145,7 @@ static_install_route (afi_t afi, safi_t safi, struct prefix *p, struct static_ro
case STATIC_IFINDEX:
nexthop = rib_nexthop_ifindex_add (rib, si->ifindex);
break;
- case STATIC_IPV4_BLACKHOLE:
+ case STATIC_BLACKHOLE:
nexthop = rib_nexthop_blackhole_add (rib);
break;
case STATIC_IPV6_GATEWAY:
@@ -219,7 +219,7 @@ static_nexthop_same (struct nexthop *nexthop, struct static_route *si)
int gw_match = 0;
if (nexthop->type == NEXTHOP_TYPE_BLACKHOLE
- && si->type == STATIC_IPV4_BLACKHOLE)
+ && si->type == STATIC_BLACKHOLE)
return 1;
if (nexthop->type == NEXTHOP_TYPE_IPV4
diff --git a/zebra/zebra_static.h b/zebra/zebra_static.h
index 5b6f429761..5e3177e3b8 100644
--- a/zebra/zebra_static.h
+++ b/zebra/zebra_static.h
@@ -51,7 +51,7 @@ struct static_route
u_char type;
#define STATIC_IFINDEX 1
#define STATIC_IPV4_GATEWAY 2
-#define STATIC_IPV4_BLACKHOLE 3
+#define STATIC_BLACKHOLE 3
#define STATIC_IPV6_GATEWAY 4
#define STATIC_IPV6_GATEWAY_IFINDEX 5
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 12084968b7..6002b0d6fa 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -70,7 +70,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd,
struct zebra_vrf *zvrf = NULL;
unsigned int ifindex = 0;
const char *ifname = NULL;
- u_char type = STATIC_IPV4_BLACKHOLE;
+ u_char type = STATIC_BLACKHOLE;
struct static_nh_label snh_label;
memset (&snh_label, 0, sizeof (struct static_nh_label));
@@ -3690,13 +3690,13 @@ static_config_ipv4 (struct vty *vty, safi_t safi, const char *cmd)
case STATIC_IFINDEX:
vty_out (vty, " %s", si->ifname);
break;
- case STATIC_IPV4_BLACKHOLE:
+ case STATIC_BLACKHOLE:
vty_out (vty, " Null0");
break;
}
- /* flags are incompatible with STATIC_IPV4_BLACKHOLE */
- if (si->type != STATIC_IPV4_BLACKHOLE)
+ /* flags are incompatible with STATIC_BLACKHOLE */
+ if (si->type != STATIC_BLACKHOLE)
{
if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT))
vty_out (vty, " %s", "reject");
@@ -3742,7 +3742,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
struct prefix p;
struct in6_addr *gate = NULL;
struct in6_addr gate_addr;
- u_char type = 0;
+ u_char type = STATIC_BLACKHOLE;
u_char flag = 0;
route_tag_t tag = 0;
unsigned int ifindex = 0;
@@ -3760,23 +3760,6 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
/* Apply mask for given prefix. */
apply_mask (&p);
- /* Route flags */
- if (flag_str) {
- switch(flag_str[0]) {
- case 'r':
- case 'R': /* XXX */
- SET_FLAG (flag, ZEBRA_FLAG_REJECT);
- break;
- case 'b':
- case 'B': /* XXX */
- SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE);
- break;
- default:
- vty_out (vty, "%% Malformed flag %s %s", flag_str, VTY_NEWLINE);
- return CMD_WARNING;
- }
- }
-
/* Administrative distance. */
if (distance_str)
distance = atoi (distance_str);
@@ -3812,7 +3795,41 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
}
}
- if (ifname)
+ /* Null0 static route. */
+ if ((gate_str != NULL) && (strncasecmp (gate_str, "Null0", strlen (gate_str)) == 0))
+ {
+ if (flag_str)
+ {
+ vty_out (vty, "%% can not have flag %s with Null0%s", flag_str, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ if (add_cmd)
+ static_add_route (AFI_IP6, SAFI_UNICAST, type, &p, NULL, ifindex, ifname,
+ ZEBRA_FLAG_BLACKHOLE, tag, distance, zvrf, &snh_label);
+ else
+ static_delete_route (AFI_IP6, SAFI_UNICAST, type, &p, NULL, ifindex, tag,
+ distance, zvrf, &snh_label);
+ return CMD_SUCCESS;
+ }
+
+ /* Route flags */
+ if (flag_str) {
+ switch(flag_str[0]) {
+ case 'r':
+ case 'R': /* XXX */
+ SET_FLAG (flag, ZEBRA_FLAG_REJECT);
+ break;
+ case 'b':
+ case 'B': /* XXX */
+ SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE);
+ break;
+ default:
+ vty_out (vty, "%% Malformed flag %s %s", flag_str, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ }
+
+ if (ifname)
{
/* When ifname is specified. It must be come with gateway
address. */
@@ -3865,24 +3882,26 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
DEFUN (ipv6_route,
ipv6_route_cmd,
- "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE)",
+ "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0)",
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
- "IPv6 gateway interface name\n")
+ "IPv6 gateway interface name\n"
+ "Null interface\n")
{
return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, NULL, NULL, NULL, NULL);
}
DEFUN (ipv6_route_tag,
ipv6_route_tag_cmd,
- "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295>",
+ "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) tag <1-4294967295>",
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Set tag for this route\n"
"Tag value\n")
{
@@ -3976,12 +3995,13 @@ DEFUN (ipv6_route_ifname_flags_tag,
DEFUN (ipv6_route_pref,
ipv6_route_pref_cmd,
- "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255>",
+ "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) <1-255>",
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Distance value for this prefix\n")
{
return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, NULL, argv[2], NULL, NULL);
@@ -3989,12 +4009,13 @@ DEFUN (ipv6_route_pref,
DEFUN (ipv6_route_pref_tag,
ipv6_route_pref_tag_cmd,
- "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255>",
+ "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) tag <1-4294967295> <1-255>",
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Set tag for this route\n"
"Tag value\n"
"Distance value for this prefix\n")
@@ -4096,26 +4117,28 @@ DEFUN (ipv6_route_ifname_flags_pref_tag,
DEFUN (no_ipv6_route,
no_ipv6_route_cmd,
- "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE)",
+ "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0)",
NO_STR
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
- "IPv6 gateway interface name\n")
+ "IPv6 gateway interface name\n"
+ "Null Interface\n")
{
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, NULL, NULL, NULL, NULL);
}
DEFUN (no_ipv6_route_tag,
no_ipv6_route_tag_cmd,
- "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295>",
+ "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) tag <1-4294967295>",
NO_STR
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Set tag for this route\n"
"Tag value\n")
{
@@ -4216,13 +4239,14 @@ DEFUN (no_ipv6_route_ifname_flags_tag,
DEFUN (no_ipv6_route_pref,
no_ipv6_route_pref_cmd,
- "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255>",
+ "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) <1-255>",
NO_STR
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Distance value for this prefix\n")
{
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, NULL, argv[2], NULL, NULL);
@@ -4230,13 +4254,14 @@ DEFUN (no_ipv6_route_pref,
DEFUN (no_ipv6_route_pref_tag,
no_ipv6_route_pref_tag_cmd,
- "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255>",
+ "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) tag <1-4294967295> <1-255>",
NO_STR
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Set tag for this route\n"
"Tag value\n"
"Distance value for this prefix\n")
@@ -4346,12 +4371,13 @@ DEFUN (no_ipv6_route_ifname_flags_pref_tag,
DEFUN (ipv6_route_vrf,
ipv6_route_vrf_cmd,
- "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) " VRF_CMD_STR,
+ "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) " VRF_CMD_STR,
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
VRF_CMD_HELP_STR)
{
return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, NULL, NULL, argv[2], NULL);
@@ -4359,12 +4385,13 @@ DEFUN (ipv6_route_vrf,
DEFUN (ipv6_route_tag_vrf,
ipv6_route_tag_vrf_cmd,
- "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> " VRF_CMD_STR,
+ "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) tag <1-4294967295> " VRF_CMD_STR,
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Set tag for this route\n"
"Tag value\n"
VRF_CMD_HELP_STR)
@@ -4465,12 +4492,13 @@ DEFUN (ipv6_route_ifname_flags_tag_vrf,
DEFUN (ipv6_route_pref_vrf,
ipv6_route_pref_vrf_cmd,
- "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255> " VRF_CMD_STR,
+ "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) <1-255> " VRF_CMD_STR,
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Distance value for this prefix\n"
VRF_CMD_HELP_STR)
{
@@ -4479,12 +4507,13 @@ DEFUN (ipv6_route_pref_vrf,
DEFUN (ipv6_route_pref_tag_vrf,
ipv6_route_pref_tag_vrf_cmd,
- "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255> " VRF_CMD_STR,
+ "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) tag <1-4294967295> <1-255> " VRF_CMD_STR,
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Set tag for this route\n"
"Tag value\n"
"Distance value for this prefix\n"
@@ -4593,13 +4622,14 @@ DEFUN (ipv6_route_ifname_flags_pref_tag_vrf,
DEFUN (no_ipv6_route_vrf,
no_ipv6_route_vrf_cmd,
- "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) " VRF_CMD_STR,
+ "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) " VRF_CMD_STR,
NO_STR
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
VRF_CMD_HELP_STR)
{
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, NULL, NULL, argv[2], NULL);
@@ -4607,13 +4637,14 @@ DEFUN (no_ipv6_route_vrf,
DEFUN (no_ipv6_route_tag_vrf,
no_ipv6_route_tag_vrf_cmd,
- "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> " VRF_CMD_STR,
+ "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) tag <1-4294967295> " VRF_CMD_STR,
NO_STR
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Set tag for this route\n"
"Tag value\n"
VRF_CMD_HELP_STR)
@@ -4721,13 +4752,14 @@ DEFUN (no_ipv6_route_ifname_flags_tag_vrf,
DEFUN (no_ipv6_route_pref_vrf,
no_ipv6_route_pref_vrf_cmd,
- "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255> " VRF_CMD_STR,
+ "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) <1-255> " VRF_CMD_STR,
NO_STR
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Distance value for this prefix\n"
VRF_CMD_HELP_STR)
{
@@ -4736,13 +4768,14 @@ DEFUN (no_ipv6_route_pref_vrf,
DEFUN (no_ipv6_route_pref_tag_vrf,
no_ipv6_route_pref_tag_vrf_cmd,
- "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255> " VRF_CMD_STR,
+ "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE|null0) tag <1-4294967295> <1-255> " VRF_CMD_STR,
NO_STR
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 gateway interface name\n"
+ "Null interface\n"
"Set tag for this route\n"
"Tag value\n"
"Distance value for this prefix\n"
@@ -5759,6 +5792,9 @@ static_config_ipv6 (struct vty *vty)
case STATIC_IFINDEX:
vty_out (vty, " %s", si->ifname);
break;
+ case STATIC_BLACKHOLE:
+ vty_out (vty, " Null0" );
+ break;
case STATIC_IPV6_GATEWAY_IFINDEX:
vty_out (vty, " %s %s",
inet_ntop (AF_INET6, &si->addr.ipv6, buf, BUFSIZ),
@@ -5766,11 +5802,14 @@ static_config_ipv6 (struct vty *vty)
break;
}
- if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT))
- vty_out (vty, " %s", "reject");
-
- if (CHECK_FLAG(si->flags, ZEBRA_FLAG_BLACKHOLE))
- vty_out (vty, " %s", "blackhole");
+ /* flags are incompatible with STATIC_BLACKHOLE */
+ if (si->type != STATIC_BLACKHOLE)
+ {
+ if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT))
+ vty_out (vty, " %s", "reject");
+ if (CHECK_FLAG(si->flags, ZEBRA_FLAG_BLACKHOLE))
+ vty_out (vty, " %s", "blackhole");
+ }
if (si->tag)
vty_out (vty, " tag %"ROUTE_TAG_PRI, si->tag);