From: Donald Sharp Date: Fri, 4 Dec 2015 17:52:49 +0000 (-0500) Subject: ZEBRA: Remove NEXTHOP_TYPE_XXX_IFNAME X-Git-Tag: frr-2.0-rc1~1177 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=3ee39b5ba0c9c60a7067d53dd21ff8dd7304b376;p=mirror%2Ffrr.git ZEBRA: Remove NEXTHOP_TYPE_XXX_IFNAME The NEXTHOP_TYPE_XXX_IFNAME types were never being used. Remove them and the code associated with them. Signed-off-by: Donald Sharp --- diff --git a/lib/nexthop.c b/lib/nexthop.c index 5eb2182de0..2a8d343a8c 100644 --- a/lib/nexthop.c +++ b/lib/nexthop.c @@ -50,23 +50,19 @@ nexthop_same_no_recurse (struct nexthop *next1, struct nexthop *next2) return 0; break; case NEXTHOP_TYPE_IFINDEX: - case NEXTHOP_TYPE_IFNAME: if (next1->ifindex != next2->ifindex) return 0; break; -#ifdef HAVE_IPV6 case NEXTHOP_TYPE_IPV6: if (! IPV6_ADDR_SAME (&next1->gate.ipv6, &next2->gate.ipv6)) return 0; break; case NEXTHOP_TYPE_IPV6_IFINDEX: - case NEXTHOP_TYPE_IPV6_IFNAME: if (! IPV6_ADDR_SAME (&next1->gate.ipv6, &next2->gate.ipv6)) return 0; if (next1->ifindex != next2->ifindex) return 0; break; -#endif /* HAVE_IPV6 */ default: /* do nothing */ break; @@ -132,8 +128,6 @@ copy_nexthops (struct nexthop **tnh, struct nexthop *nh) nexthop->flags = nh->flags; nexthop->type = nh->type; nexthop->ifindex = nh->ifindex; - if (nh->ifname) - nexthop->ifname = XSTRDUP(0, nh->ifname); memcpy(&(nexthop->gate), &(nh->gate), sizeof(union g_addr)); memcpy(&(nexthop->src), &(nh->src), sizeof(union g_addr)); nexthop_add(tnh, nexthop); @@ -147,8 +141,6 @@ copy_nexthops (struct nexthop **tnh, struct nexthop *nh) void nexthop_free (struct nexthop *nexthop) { - if (nexthop->ifname) - XFREE (0, nexthop->ifname); if (nexthop->resolved) nexthops_free(nexthop->resolved); XFREE (MTYPE_NEXTHOP, nexthop); diff --git a/lib/nexthop.h b/lib/nexthop.h index 8a3a7620ab..eb9b27ea9e 100644 --- a/lib/nexthop.h +++ b/lib/nexthop.h @@ -34,13 +34,10 @@ union g_addr { enum nexthop_types_t { NEXTHOP_TYPE_IFINDEX = 1, /* Directly connected. */ - NEXTHOP_TYPE_IFNAME, /* Interface route. */ NEXTHOP_TYPE_IPV4, /* IPv4 nexthop. */ NEXTHOP_TYPE_IPV4_IFINDEX, /* IPv4 nexthop with ifindex. */ - NEXTHOP_TYPE_IPV4_IFNAME, /* IPv4 nexthop with ifname. */ NEXTHOP_TYPE_IPV6, /* IPv6 nexthop. */ NEXTHOP_TYPE_IPV6_IFINDEX, /* IPv6 nexthop with ifindex. */ - NEXTHOP_TYPE_IPV6_IFNAME, /* IPv6 nexthop with ifname. */ NEXTHOP_TYPE_BLACKHOLE, /* Null0 nexthop. */ }; @@ -51,7 +48,6 @@ struct nexthop struct nexthop *prev; /* Interface index. */ - char *ifname; unsigned int ifindex; enum nexthop_types_t type; diff --git a/lib/zebra.h b/lib/zebra.h index 47665ea9c4..134779a7ea 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -499,15 +499,12 @@ extern const char *zserv_command_string (unsigned int command); /* Zebra nexthop flags. */ #define ZEBRA_NEXTHOP_IFINDEX 1 -#define ZEBRA_NEXTHOP_IFNAME 2 -#define ZEBRA_NEXTHOP_IPV4 3 -#define ZEBRA_NEXTHOP_IPV4_IFINDEX 4 -#define ZEBRA_NEXTHOP_IPV4_IFNAME 5 -#define ZEBRA_NEXTHOP_IPV6 6 -#define ZEBRA_NEXTHOP_IPV6_IFINDEX 7 -#define ZEBRA_NEXTHOP_IPV6_IFNAME 8 -#define ZEBRA_NEXTHOP_BLACKHOLE 9 -#define ZEBRA_NEXTHOP_IPV4_ONLINK 10 +#define ZEBRA_NEXTHOP_IPV4 2 +#define ZEBRA_NEXTHOP_IPV4_IFINDEX 3 +#define ZEBRA_NEXTHOP_IPV6 4 +#define ZEBRA_NEXTHOP_IPV6_IFINDEX 5 +#define ZEBRA_NEXTHOP_BLACKHOLE 6 +#define ZEBRA_NEXTHOP_IPV4_ONLINK 7 #ifndef INADDR_LOOPBACK #define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */ diff --git a/zebra/rib.h b/zebra/rib.h index 3a47c8ad5e..bb2c084c47 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -371,7 +371,6 @@ typedef struct rib_tables_iter_t_ } rib_tables_iter_t; extern struct nexthop *rib_nexthop_ifindex_add (struct rib *, unsigned int); -extern struct nexthop *rib_nexthop_ifname_add (struct rib *, char *); extern struct nexthop *rib_nexthop_blackhole_add (struct rib *); extern struct nexthop *rib_nexthop_ipv4_add (struct rib *, struct in_addr *, struct in_addr *); @@ -400,9 +399,6 @@ extern struct nexthop *rib_nexthop_ipv6_add (struct rib *, struct in6_addr *); extern struct nexthop *rib_nexthop_ipv6_ifindex_add (struct rib *rib, struct in6_addr *ipv6, unsigned int ifindex); -extern struct nexthop *rib_nexthop_ipv6_ifname_add (struct rib *rib, - struct in6_addr *ipv6, - char *ifname); extern struct zebra_vrf *zebra_vrf_lookup (vrf_id_t vrf_id); extern struct zebra_vrf *zebra_vrf_alloc (vrf_id_t); diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index e15e0eabb4..b49dcc1755 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1504,7 +1504,6 @@ _netlink_route_build_singlepath( if (rtmsg->rtm_family == AF_INET && (nexthop->type == NEXTHOP_TYPE_IPV6 - || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX)) { char buf[16] = "169.254.0.1"; @@ -1555,9 +1554,7 @@ _netlink_route_build_singlepath( inet_ntoa (nexthop->gate.ipv4), nexthop->ifindex); } -#ifdef HAVE_IPV6 if (nexthop->type == NEXTHOP_TYPE_IPV6 - || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) { addattr_l (nlmsg, req_size, RTA_GATEWAY, @@ -1580,9 +1577,7 @@ _netlink_route_build_singlepath( inet6_ntoa (nexthop->gate.ipv6), nexthop->ifindex); } -#endif /* HAVE_IPV6 */ if (nexthop->type == NEXTHOP_TYPE_IFINDEX - || nexthop->type == NEXTHOP_TYPE_IFNAME || nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) { addattr32 (nlmsg, req_size, RTA_OIF, nexthop->ifindex); @@ -1602,8 +1597,7 @@ _netlink_route_build_singlepath( "nexthop via if %u", routedesc, nexthop->ifindex); } - if (nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX - || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME) + if (nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) { addattr32 (nlmsg, req_size, RTA_OIF, nexthop->ifindex); @@ -1656,7 +1650,6 @@ _netlink_route_build_multipath( if (rtmsg->rtm_family == AF_INET && (nexthop->type == NEXTHOP_TYPE_IPV6 - || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX)) { char buf[16] = "169.254.0.1"; @@ -1705,9 +1698,7 @@ _netlink_route_build_multipath( inet_ntoa (nexthop->gate.ipv4), nexthop->ifindex); } -#ifdef HAVE_IPV6 if (nexthop->type == NEXTHOP_TYPE_IPV6 - || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) { rta_addattr_l (rta, NL_PKT_BUF_SIZE, RTA_GATEWAY, @@ -1726,11 +1717,9 @@ _netlink_route_build_multipath( inet6_ntoa (nexthop->gate.ipv6), nexthop->ifindex); } -#endif /* HAVE_IPV6 */ /* ifindex */ if (nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX - || nexthop->type == NEXTHOP_TYPE_IFINDEX - || nexthop->type == NEXTHOP_TYPE_IFNAME) + || nexthop->type == NEXTHOP_TYPE_IFINDEX) { rtnh->rtnh_ifindex = nexthop->ifindex; @@ -1743,8 +1732,7 @@ _netlink_route_build_multipath( zlog_debug("netlink_route_multipath() (%s): " "nexthop via if %u", routedesc, nexthop->ifindex); } - else if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME - || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) + else if (nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) { rtnh->rtnh_ifindex = nexthop->ifindex; diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c index 9af2d61dbb..cc327ffbb0 100644 --- a/zebra/rt_socket.c +++ b/zebra/rt_socket.c @@ -123,7 +123,6 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family) gate = 1; } if (nexthop->type == NEXTHOP_TYPE_IFINDEX - || nexthop->type == NEXTHOP_TYPE_IFNAME || nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) ifindex = nexthop->ifindex; if (nexthop->type == NEXTHOP_TYPE_BLACKHOLE) @@ -388,15 +387,12 @@ kernel_rtm_ipv6_multipath (int cmd, struct prefix *p, struct rib *rib, )) { if (nexthop->type == NEXTHOP_TYPE_IPV6 - || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) { sin_gate.sin6_addr = nexthop->gate.ipv6; gate = 1; } if (nexthop->type == NEXTHOP_TYPE_IFINDEX - || nexthop->type == NEXTHOP_TYPE_IFNAME - || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) ifindex = nexthop->ifindex; diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c index c53d282b63..dc6c12a23e 100644 --- a/zebra/zebra_fpm_netlink.c +++ b/zebra/zebra_fpm_netlink.c @@ -176,17 +176,13 @@ netlink_route_info_add_nh (netlink_route_info_t *ri, struct nexthop *nexthop, src = &nexthop->src; } -#ifdef HAVE_IPV6 if (nexthop->type == NEXTHOP_TYPE_IPV6 - || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) { nhi.gateway = &nexthop->gate; } -#endif /* HAVE_IPV6 */ - if (nexthop->type == NEXTHOP_TYPE_IFINDEX - || nexthop->type == NEXTHOP_TYPE_IFNAME) + if (nexthop->type == NEXTHOP_TYPE_IFINDEX) { if (nexthop->src.ipv4.s_addr) src = &nexthop->src; diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index a3f19a2442..27e0314b01 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -147,8 +147,6 @@ rib_copy_nexthops (struct rib *rib, struct nexthop *nh) nexthop->flags = nh->flags; nexthop->type = nh->type; nexthop->ifindex = nh->ifindex; - if (nh->ifname) - nexthop->ifname = XSTRDUP(0, nh->ifname); memcpy(&(nexthop->gate), &(nh->gate), sizeof(union g_addr)); memcpy(&(nexthop->src), &(nh->src), sizeof(union g_addr)); rib_nexthop_add(rib, nexthop); @@ -185,20 +183,6 @@ rib_nexthop_ifindex_add (struct rib *rib, unsigned int ifindex) return nexthop; } -struct nexthop * -rib_nexthop_ifname_add (struct rib *rib, char *ifname) -{ - struct nexthop *nexthop; - - nexthop = nexthop_new(); - nexthop->type = NEXTHOP_TYPE_IFNAME; - nexthop->ifname = XSTRDUP (0, ifname); - - rib_nexthop_add (rib, nexthop); - - return nexthop; -} - struct nexthop * rib_nexthop_ipv4_add (struct rib *rib, struct in_addr *ipv4, struct in_addr *src) { @@ -429,8 +413,7 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, SET_FLAG (resolved_hop->flags, NEXTHOP_FLAG_ACTIVE); /* If the resolving route specifies a gateway, use it */ if (newhop->type == NEXTHOP_TYPE_IPV4 - || newhop->type == NEXTHOP_TYPE_IPV4_IFINDEX - || newhop->type == NEXTHOP_TYPE_IPV4_IFNAME) + || newhop->type == NEXTHOP_TYPE_IPV4_IFINDEX) { resolved_hop->type = newhop->type; resolved_hop->gate.ipv4 = newhop->gate.ipv4; @@ -452,8 +435,7 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, * * On Linux, we have to set the onlink netlink flag because * otherwise, the kernel won't accept the route. */ - if (newhop->type == NEXTHOP_TYPE_IFINDEX - || newhop->type == NEXTHOP_TYPE_IFNAME) + if (newhop->type == NEXTHOP_TYPE_IFINDEX) { resolved_hop->flags |= NEXTHOP_FLAG_ONLINK; resolved_hop->type = NEXTHOP_TYPE_IPV4_IFINDEX; @@ -481,8 +463,7 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, SET_FLAG (resolved_hop->flags, NEXTHOP_FLAG_ACTIVE); /* If the resolving route specifies a gateway, use it */ if (newhop->type == NEXTHOP_TYPE_IPV4 - || newhop->type == NEXTHOP_TYPE_IPV4_IFINDEX - || newhop->type == NEXTHOP_TYPE_IPV4_IFNAME) + || newhop->type == NEXTHOP_TYPE_IPV4_IFINDEX) { resolved_hop->type = newhop->type; resolved_hop->gate.ipv4 = newhop->gate.ipv4; @@ -505,8 +486,7 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, * On Linux, we have to set the onlink netlink flag because * otherwise, the kernel won't accept the route. */ - if (newhop->type == NEXTHOP_TYPE_IFINDEX - || newhop->type == NEXTHOP_TYPE_IFNAME) + if (newhop->type == NEXTHOP_TYPE_IFINDEX) { resolved_hop->flags |= NEXTHOP_FLAG_ONLINK; resolved_hop->type = NEXTHOP_TYPE_IPV4_IFINDEX; @@ -640,8 +620,7 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set, /* See nexthop_active_ipv4 for a description how the * resolved nexthop is constructed. */ if (newhop->type == NEXTHOP_TYPE_IPV6 - || newhop->type == NEXTHOP_TYPE_IPV6_IFINDEX - || newhop->type == NEXTHOP_TYPE_IPV6_IFNAME) + || newhop->type == NEXTHOP_TYPE_IPV6_IFINDEX) { resolved_hop->type = newhop->type; resolved_hop->gate.ipv6 = newhop->gate.ipv6; @@ -653,8 +632,7 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set, } } - if (newhop->type == NEXTHOP_TYPE_IFINDEX - || newhop->type == NEXTHOP_TYPE_IFNAME) + if (newhop->type == NEXTHOP_TYPE_IFINDEX) { resolved_hop->flags |= NEXTHOP_FLAG_ONLINK; resolved_hop->type = NEXTHOP_TYPE_IPV6_IFINDEX; @@ -683,8 +661,7 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set, /* See nexthop_active_ipv4 for a description how the * resolved nexthop is constructed. */ if (newhop->type == NEXTHOP_TYPE_IPV6 - || newhop->type == NEXTHOP_TYPE_IPV6_IFINDEX - || newhop->type == NEXTHOP_TYPE_IPV6_IFNAME) + || newhop->type == NEXTHOP_TYPE_IPV6_IFINDEX) { resolved_hop->type = newhop->type; resolved_hop->gate.ipv6 = newhop->gate.ipv6; @@ -696,8 +673,7 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set, } } - if (newhop->type == NEXTHOP_TYPE_IFINDEX - || newhop->type == NEXTHOP_TYPE_IFNAME) + if (newhop->type == NEXTHOP_TYPE_IFINDEX) { resolved_hop->flags |= NEXTHOP_FLAG_ONLINK; resolved_hop->type = NEXTHOP_TYPE_IPV6_IFINDEX; @@ -1004,23 +980,6 @@ nexthop_active_check (struct route_node *rn, struct rib *rib, else UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE); break; - case NEXTHOP_TYPE_IPV6_IFNAME: - family = AFI_IP6; - case NEXTHOP_TYPE_IFNAME: - ifp = if_lookup_by_name_vrf (nexthop->ifname, rib->vrf_id); - if (ifp && if_is_operative(ifp)) - { - if (set) - nexthop->ifindex = ifp->ifindex; - SET_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE); - } - else - { - if (set) - nexthop->ifindex = 0; - UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE); - } - break; case NEXTHOP_TYPE_IPV4: case NEXTHOP_TYPE_IPV4_IFINDEX: family = AFI_IP; @@ -1092,7 +1051,8 @@ nexthop_active_check (struct route_node *rn, struct rib *rib, { inet_ntop (rn->p.family, &rn->p.u.prefix, buf, sizeof (buf)); zlog_debug("%u:%s/%d: Filtering out with NH out %s due to route map", - rib->vrf_id, buf, rn->p.prefixlen, nexthop->ifname); + rib->vrf_id, buf, rn->p.prefixlen, + ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id)); } UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE); } diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index 5d16dbba4f..4833fa2182 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -1207,11 +1207,9 @@ route_match_ip_next_hop (void *rule, struct prefix *prefix, switch (nh_data->nexthop->type) { case NEXTHOP_TYPE_IFINDEX: - case NEXTHOP_TYPE_IFNAME: /* Interface routes can't match ip next-hop */ return RMAP_NOMATCH; case NEXTHOP_TYPE_IPV4_IFINDEX: - case NEXTHOP_TYPE_IPV4_IFNAME: case NEXTHOP_TYPE_IPV4: p.family = AF_INET; p.prefix = nh_data->nexthop->gate.ipv4; @@ -1272,11 +1270,9 @@ route_match_ip_next_hop_prefix_list (void *rule, struct prefix *prefix, switch (nh_data->nexthop->type) { case NEXTHOP_TYPE_IFINDEX: - case NEXTHOP_TYPE_IFNAME: /* Interface routes can't match ip next-hop */ return RMAP_NOMATCH; case NEXTHOP_TYPE_IPV4_IFINDEX: - case NEXTHOP_TYPE_IPV4_IFNAME: case NEXTHOP_TYPE_IPV4: p.family = AF_INET; p.prefix = nh_data->nexthop->gate.ipv4; @@ -1475,11 +1471,9 @@ route_match_ip_nexthop_prefix_len (void *rule, struct prefix *prefix, switch (nh_data->nexthop->type) { case NEXTHOP_TYPE_IFINDEX: - case NEXTHOP_TYPE_IFNAME: /* Interface routes can't match ip next-hop */ return RMAP_NOMATCH; case NEXTHOP_TYPE_IPV4_IFINDEX: - case NEXTHOP_TYPE_IPV4_IFNAME: case NEXTHOP_TYPE_IPV4: p.family = AF_INET; p.prefix = nh_data->nexthop->gate.ipv4; diff --git a/zebra/zebra_snmp.c b/zebra/zebra_snmp.c index 3d005aa55a..fbd0379fcd 100644 --- a/zebra/zebra_snmp.c +++ b/zebra/zebra_snmp.c @@ -493,8 +493,7 @@ ipFwTable (struct variable *v, oid objid[], size_t *objid_len, return (u_char *)&nexthop->ifindex; break; case IPFORWARDTYPE: - if (nexthop->type == NEXTHOP_TYPE_IFINDEX - || nexthop->type == NEXTHOP_TYPE_IFNAME) + if (nexthop->type == NEXTHOP_TYPE_IFINDEX) result = 3; else result = 4; diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index a2c6edbf62..06f9f14e86 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -1824,12 +1824,9 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn) #ifdef HAVE_IPV6 case NEXTHOP_TYPE_IPV6: case NEXTHOP_TYPE_IPV6_IFINDEX: - case NEXTHOP_TYPE_IPV6_IFNAME: vty_out (vty, " %s", inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ)); - if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME) - vty_out (vty, ", %s", nexthop->ifname); - else if (nexthop->ifindex) + if (nexthop->ifindex) vty_out (vty, ", via %s", ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id)); break; @@ -1838,9 +1835,6 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn) vty_out (vty, " directly connected, %s", ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id)); break; - case NEXTHOP_TYPE_IFNAME: - vty_out (vty, " directly connected, %s", nexthop->ifname); - break; case NEXTHOP_TYPE_BLACKHOLE: vty_out (vty, " directly connected, Null0"); break; @@ -1860,7 +1854,6 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn) { case NEXTHOP_TYPE_IPV4: case NEXTHOP_TYPE_IPV4_IFINDEX: - case NEXTHOP_TYPE_IPV4_IFNAME: if (nexthop->src.ipv4.s_addr) { if (inet_ntop(AF_INET, &nexthop->src.ipv4, addrstr, @@ -1868,10 +1861,8 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn) vty_out (vty, ", src %s", addrstr); } break; -#ifdef HAVE_IPV6 case NEXTHOP_TYPE_IPV6: case NEXTHOP_TYPE_IPV6_IFINDEX: - case NEXTHOP_TYPE_IPV6_IFNAME: if (!IPV6_ADDR_SAME(&nexthop->src.ipv6, &in6addr_any)) { if (inet_ntop(AF_INET6, &nexthop->src.ipv6, addrstr, @@ -1879,7 +1870,6 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn) vty_out (vty, ", src %s", addrstr); } break; -#endif /* HAVE_IPV6 */ default: break; } @@ -1941,12 +1931,9 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib) #ifdef HAVE_IPV6 case NEXTHOP_TYPE_IPV6: case NEXTHOP_TYPE_IPV6_IFINDEX: - case NEXTHOP_TYPE_IPV6_IFNAME: vty_out (vty, " via %s", inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ)); - if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME) - vty_out (vty, ", %s", nexthop->ifname); - else if (nexthop->ifindex) + if (nexthop->ifindex) vty_out (vty, ", %s", ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id)); break; @@ -1956,9 +1943,6 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib) vty_out (vty, " is directly connected, %s", ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id)); break; - case NEXTHOP_TYPE_IFNAME: - vty_out (vty, " is directly connected, %s", nexthop->ifname); - break; case NEXTHOP_TYPE_BLACKHOLE: vty_out (vty, " is directly connected, Null0"); break; @@ -1978,7 +1962,6 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib) { case NEXTHOP_TYPE_IPV4: case NEXTHOP_TYPE_IPV4_IFINDEX: - case NEXTHOP_TYPE_IPV4_IFNAME: if (nexthop->src.ipv4.s_addr) { if (inet_ntop(AF_INET, &nexthop->src.ipv4, buf, sizeof buf)) @@ -1988,7 +1971,6 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib) #ifdef HAVE_IPV6 case NEXTHOP_TYPE_IPV6: case NEXTHOP_TYPE_IPV6_IFINDEX: - case NEXTHOP_TYPE_IPV6_IFNAME: if (!IPV6_ADDR_SAME(&nexthop->src.ipv6, &in6addr_any)) { if (inet_ntop(AF_INET6, &nexthop->src.ipv6, buf, sizeof buf)) @@ -4342,22 +4324,15 @@ vty_show_ipv6_route_detail (struct vty *vty, struct route_node *rn) { case NEXTHOP_TYPE_IPV6: case NEXTHOP_TYPE_IPV6_IFINDEX: - case NEXTHOP_TYPE_IPV6_IFNAME: vty_out (vty, " %s", inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ)); - if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME) - vty_out (vty, ", %s", nexthop->ifname); - else if (nexthop->ifindex) + if (nexthop->ifindex) vty_out (vty, ", via %s", ifindex2ifname (nexthop->ifindex)); break; case NEXTHOP_TYPE_IFINDEX: vty_out (vty, " directly connected, %s", ifindex2ifname (nexthop->ifindex)); break; - case NEXTHOP_TYPE_IFNAME: - vty_out (vty, " directly connected, %s", - nexthop->ifname); - break; default: break; } @@ -4416,22 +4391,15 @@ vty_show_ipv6_route (struct vty *vty, struct route_node *rn, { case NEXTHOP_TYPE_IPV6: case NEXTHOP_TYPE_IPV6_IFINDEX: - case NEXTHOP_TYPE_IPV6_IFNAME: vty_out (vty, " via %s", inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ)); - if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME) - vty_out (vty, ", %s", nexthop->ifname); - else if (nexthop->ifindex) + if (nexthop->ifindex) vty_out (vty, ", %s", ifindex2ifname (nexthop->ifindex)); break; case NEXTHOP_TYPE_IFINDEX: vty_out (vty, " is directly connected, %s", ifindex2ifname (nexthop->ifindex)); break; - case NEXTHOP_TYPE_IFNAME: - vty_out (vty, " is directly connected, %s", - nexthop->ifname); - break; default: break; } diff --git a/zebra/zserv.c b/zebra/zserv.c index 92482dc4f8..9a67724f45 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -580,17 +580,14 @@ zsend_redistribute_route (int cmd, struct zserv *client, struct prefix *p, case NEXTHOP_TYPE_IPV4_IFINDEX: stream_put_in_addr (s, &nexthop->gate.ipv4); break; -#ifdef HAVE_IPV6 case NEXTHOP_TYPE_IPV6: case NEXTHOP_TYPE_IPV6_IFINDEX: - case NEXTHOP_TYPE_IPV6_IFNAME: /* Only BGP supports IPv4 prefix with IPv6 NH, so kill this */ if (p->family == AF_INET) stream_put_in_addr(s, &dummy_nh.gate.ipv4); else stream_write (s, (u_char *) &nexthop->gate.ipv6, 16); break; -#endif default: if (cmd == ZEBRA_REDISTRIBUTE_IPV4_ADD || cmd == ZEBRA_REDISTRIBUTE_IPV4_DEL) @@ -685,12 +682,10 @@ zsend_ipv6_nexthop_lookup (struct zserv *client, struct in6_addr *addr, stream_put (s, &nexthop->gate.ipv6, 16); break; case ZEBRA_NEXTHOP_IPV6_IFINDEX: - case ZEBRA_NEXTHOP_IPV6_IFNAME: stream_put (s, &nexthop->gate.ipv6, 16); stream_putl (s, nexthop->ifindex); break; case ZEBRA_NEXTHOP_IFINDEX: - case ZEBRA_NEXTHOP_IFNAME: stream_putl (s, nexthop->ifindex); break; default: @@ -759,7 +754,6 @@ zsend_ipv4_nexthop_lookup (struct zserv *client, struct in_addr addr, stream_putl (s, nexthop->ifindex); break; case ZEBRA_NEXTHOP_IFINDEX: - case ZEBRA_NEXTHOP_IFNAME: stream_putl (s, nexthop->ifindex); break; default: @@ -938,7 +932,6 @@ zsend_ipv4_import_lookup (struct zserv *client, struct prefix_ipv4 *p, stream_putl (s, nexthop->ifindex); break; case ZEBRA_NEXTHOP_IFINDEX: - case ZEBRA_NEXTHOP_IFNAME: stream_putl (s, nexthop->ifindex); break; default: @@ -1068,7 +1061,6 @@ zread_ipv4_add (struct zserv *client, u_short length, vrf_id_t vrf_id) u_char nexthop_type; struct stream *s; unsigned int ifindex; - u_char ifname_len; safi_t safi; int ret; @@ -1111,10 +1103,6 @@ zread_ipv4_add (struct zserv *client, u_short length, vrf_id_t vrf_id) ifindex = stream_getl (s); rib_nexthop_ifindex_add (rib, ifindex); break; - case ZEBRA_NEXTHOP_IFNAME: - ifname_len = stream_getc (s); - stream_forward_getp (s, ifname_len); - break; case ZEBRA_NEXTHOP_IPV4: nexthop.s_addr = stream_get_ipv4 (s); rib_nexthop_ipv4_add (rib, &nexthop, NULL); @@ -1172,7 +1160,6 @@ zread_ipv4_delete (struct zserv *client, u_short length, vrf_id_t vrf_id) struct prefix_ipv4 p; u_char nexthop_num; u_char nexthop_type; - u_char ifname_len; s = client->ibuf; ifindex = 0; @@ -1206,10 +1193,6 @@ zread_ipv4_delete (struct zserv *client, u_short length, vrf_id_t vrf_id) case ZEBRA_NEXTHOP_IFINDEX: ifindex = stream_getl (s); break; - case ZEBRA_NEXTHOP_IFNAME: - ifname_len = stream_getc (s); - stream_forward_getp (s, ifname_len); - break; case ZEBRA_NEXTHOP_IPV4: nexthop.s_addr = stream_get_ipv4 (s); nexthop_p = &nexthop;