From f6b66ab319e8afd125f3f8eda69fe0dbf132d513 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 9 Dec 2015 04:26:02 -0800 Subject: [PATCH] zebra, bgp: Remove some missed values There were a few instances of missed values for XXX_IFNAME. Signed-off-by: Donald Sharp --- bgpd/bgp_nht.c | 3 --- zebra/redistribute.c | 3 +-- zebra/rt_ioctl.c | 6 +----- zebra/zebra_rnh.c | 11 +---------- 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 2828ec357b..b68ab1c8c2 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -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; diff --git a/zebra/redistribute.c b/zebra/redistribute.c index 1899a4d114..8cd3dddd4a 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -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; diff --git a/zebra/rt_ioctl.c b/zebra/rt_ioctl.c index 5a386e97c9..2bc64f6f3c 100644 --- a/zebra/rt_ioctl.c +++ b/zebra/rt_ioctl.c @@ -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 diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 62ae3e7bd3..1f054d3193 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -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; -- 2.39.5