]> git.puffer.fish Git - mirror/frr.git/commitdiff
ZEBRA: Remove NEXTHOP_TYPE_XXX_IFNAME
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 4 Dec 2015 17:52:49 +0000 (12:52 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 4 Dec 2015 18:44:37 +0000 (10:44 -0800)
The NEXTHOP_TYPE_XXX_IFNAME types were never being used.  Remove them
and the code associated with them.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
12 files changed:
lib/nexthop.c
lib/nexthop.h
lib/zebra.h
zebra/rib.h
zebra/rt_netlink.c
zebra/rt_socket.c
zebra/zebra_fpm_netlink.c
zebra/zebra_rib.c
zebra/zebra_routemap.c
zebra/zebra_snmp.c
zebra/zebra_vty.c
zebra/zserv.c

index 5eb2182de0963d365a3ddff02680baae41475a08..2a8d343a8c725550ad3a7e860ce352ccc69d1508 100644 (file)
@@ -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);
index 8a3a7620ab8810b10272d849cfabd3d542716cf7..eb9b27ea9e3250957e247471c36b219d68d7fbab 100644 (file)
@@ -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;
index 47665ea9c454958a24fd4385c31e621d2356d863..134779a7eabcfcbd9b56536c1fa9a90bd69bd179 100644 (file)
@@ -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.  */
index 3a47c8ad5e71880a52dc7509eb810a67889831fd..bb2c084c47ef2fea6beaf3209a99ad4360ef7da8 100644 (file)
@@ -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);
index e15e0eabb4e2c4ae8afc6a196f3129107ff7e5a6..b49dcc1755560198f65997dac91257990bf65323 100644 (file)
@@ -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;
 
index 9af2d61dbb29381c4a87098f2dae2d7785525e70..cc327ffbb0cf80a9df589a3393ca5cf6dc2202d1 100644 (file)
@@ -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;
 
index c53d282b6351bd255cec6deba5a2691d02aa36f3..dc6c12a23ec4362d2e77f25e43d37ff097ebc0e7 100644 (file)
@@ -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;
index a3f19a2442e7bb4f5b2c8b77f3258dd6b05337a4..27e0314b015a634db5d17e26c7eca6c90d1fd012 100644 (file)
@@ -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);
     }
index 5d16dbba4f15e9a896aeb28f1956f67324133d3c..4833fa2182579a75503ac2baf28bc28dc11ff657 100644 (file)
@@ -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;
index 3d005aa55abfa350a8525e669bb3c82a3e5e329f..fbd0379fcd355e8d774e2f2c109f3871aa827991 100644 (file)
@@ -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;
index a2c6edbf62069f7cabbcd4a3c7a5038d03041beb..06f9f14e8678fae6d3ff38efa7b04bea13ee67a8 100644 (file)
@@ -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;
        }
index 92482dc4f850b4cdf6fada08005240eaac7459d4..9a67724f45a77a7c633cf8a930b9c3e729d43565 100644 (file)
@@ -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;