]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra, bgp: Remove some missed values
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 9 Dec 2015 12:26:02 +0000 (04:26 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 9 Dec 2015 12:26:02 +0000 (04:26 -0800)
There were a few instances of missed values for XXX_IFNAME.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_nht.c
zebra/redistribute.c
zebra/rt_ioctl.c
zebra/zebra_rnh.c

index 2828ec357bac571754ad319c3d3e35c321eb21dd..b68ab1c8c247234366d3190b2956b92ec35637a3 100644 (file)
@@ -394,11 +394,9 @@ bgp_parse_nexthop_update (int command, vrf_id_t vrf_id)
              nexthop->gate.ipv4.s_addr = stream_get_ipv4 (s);
              break;
            case ZEBRA_NEXTHOP_IFINDEX:
-           case ZEBRA_NEXTHOP_IFNAME:
              nexthop->ifindex = stream_getl (s);
              break;
             case ZEBRA_NEXTHOP_IPV4_IFINDEX:
-           case ZEBRA_NEXTHOP_IPV4_IFNAME:
              nexthop->gate.ipv4.s_addr = stream_get_ipv4 (s);
              nexthop->ifindex = stream_getl (s);
              break;
@@ -407,7 +405,6 @@ bgp_parse_nexthop_update (int command, vrf_id_t vrf_id)
              stream_get (&nexthop->gate.ipv6, s, 16);
              break;
             case ZEBRA_NEXTHOP_IPV6_IFINDEX:
-           case ZEBRA_NEXTHOP_IPV6_IFNAME:
              stream_get (&nexthop->gate.ipv6, s, 16);
              nexthop->ifindex = stream_getl (s);
              break;
index 1899a4d114a6f75d18e361b24cf8da0185474850..8cd3dddd4a62826920476b54184fe9460648b7e6 100644 (file)
@@ -534,8 +534,7 @@ zebra_add_import_table_entry (struct route_node *rn, struct rib *rib)
       if (rib->nexthop_num == 1)
        {
          nhop = rib->nexthop;
-         if ((nhop->type == NEXTHOP_TYPE_IFINDEX) ||
-             (nhop->type == NEXTHOP_TYPE_IFNAME))
+         if (nhop->type == NEXTHOP_TYPE_IFINDEX)
            gate = NULL;
          else
            gate = &nhop->gate.ipv4;
index 5a386e97c9c1ad7a1cd942448021d89d98d003d8..2bc64f6f3cf28e440501862879119856b7b5d88a 100644 (file)
@@ -224,8 +224,7 @@ kernel_ioctl_ipv4 (u_long cmd, struct prefix *p, struct rib *rib, int family)
              sin_gate.sin_addr = nexthop->gate.ipv4;
              rtentry.rt_flags |= RTF_GATEWAY;
            }
-         if (nexthop->type == NEXTHOP_TYPE_IFINDEX
-             || nexthop->type == NEXTHOP_TYPE_IFNAME)
+         if (nexthop->type == NEXTHOP_TYPE_IFINDEX)
            {
              ifp = if_lookup_by_index (nexthop->ifindex);
              if (ifp)
@@ -460,15 +459,12 @@ kernel_ioctl_ipv6_multipath (u_long cmd, struct prefix *p, struct rib *rib,
              && CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)))
        {
          if (nexthop->type == NEXTHOP_TYPE_IPV6
-             || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME
              || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX)
            {
              memcpy (&rtm.rtmsg_gateway, &nexthop->gate.ipv6,
                      sizeof (struct in6_addr));
            }
          if (nexthop->type == NEXTHOP_TYPE_IFINDEX
-             || nexthop->type == NEXTHOP_TYPE_IFNAME
-             || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME
              || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX)
            rtm.rtmsg_ifindex = nexthop->ifindex;
          else
index 62ae3e7bd310e7b5ba9ad3f819f101a27b1e3972..1f054d3193d0bd1b7f9c652def2faa9de67d5fd8 100644 (file)
@@ -796,11 +796,9 @@ send_client (struct rnh *rnh, struct zserv *client, rnh_type_t type, vrf_id_t vr
                stream_put_in_addr (s, &nexthop->gate.ipv4);
                break;
              case ZEBRA_NEXTHOP_IFINDEX:
-             case ZEBRA_NEXTHOP_IFNAME:
                stream_putl (s, nexthop->ifindex);
                break;
              case ZEBRA_NEXTHOP_IPV4_IFINDEX:
-             case ZEBRA_NEXTHOP_IPV4_IFNAME:
                stream_put_in_addr (s, &nexthop->gate.ipv4);
                stream_putl (s, nexthop->ifindex);
                break;
@@ -809,7 +807,6 @@ send_client (struct rnh *rnh, struct zserv *client, rnh_type_t type, vrf_id_t vr
                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;
@@ -849,21 +846,15 @@ print_nh (struct nexthop *nexthop, struct vty *vty)
       break;
     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, " is directly connected, %s",
               ifindex2ifname (nexthop->ifindex));
       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;