diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2017-08-06 04:32:55 +0200 | 
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-08-06 05:22:49 +0200 | 
| commit | 7569827e30cd02e35b7ca1d0e1fae7daa55f6c58 (patch) | |
| tree | 01467fdd1601e02a3b35876fb5eeaea80bb25122 | |
| parent | 78986c05cdb4adf6019d02dc328341943c573b35 (diff) | |
zebra: static: rename IFINDEX -> IFNAME
Static routes are really held by ifname, not ifindex.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| -rw-r--r-- | zebra/zebra_static.c | 22 | ||||
| -rw-r--r-- | zebra/zebra_static.h | 6 | ||||
| -rw-r--r-- | zebra/zebra_vty.c | 14 | 
3 files changed, 21 insertions, 21 deletions
diff --git a/zebra/zebra_static.c b/zebra/zebra_static.c index 4628d11091..81c6f1911a 100644 --- a/zebra/zebra_static.c +++ b/zebra/zebra_static.c @@ -83,7 +83,7 @@ static_install_route (afi_t afi, safi_t safi, struct prefix *p,  	  nh_p.u.prefix4 = si->addr.ipv4;  	  zebra_register_rnh_static_nh(si->vrf_id, &nh_p, rn);  	  break; -	case STATIC_IFINDEX: +	case STATIC_IFNAME:  	  nexthop = rib_nexthop_ifindex_add (rib, si->ifindex);  	  break;  	case STATIC_BLACKHOLE: @@ -96,7 +96,7 @@ static_install_route (afi_t afi, safi_t safi, struct prefix *p,  	  nh_p.u.prefix6 = si->addr.ipv6;  	  zebra_register_rnh_static_nh(si->vrf_id, &nh_p, rn);  	  break; -	case STATIC_IPV6_GATEWAY_IFINDEX: +	case STATIC_IPV6_GATEWAY_IFNAME:  	  nexthop = rib_nexthop_ipv6_ifindex_add (rib, &si->addr.ipv6,  						  si->ifindex);  	  break; @@ -147,7 +147,7 @@ static_install_route (afi_t afi, safi_t safi, struct prefix *p,  	  nh_p.u.prefix4 = si->addr.ipv4;  	  zebra_register_rnh_static_nh(si->vrf_id, &nh_p, rn);  	  break; -	case STATIC_IFINDEX: +	case STATIC_IFNAME:  	  nexthop = rib_nexthop_ifindex_add (rib, si->ifindex);  	  break;  	case STATIC_BLACKHOLE: @@ -160,7 +160,7 @@ static_install_route (afi_t afi, safi_t safi, struct prefix *p,  	  nh_p.u.prefix6 = si->addr.ipv6;  	  zebra_register_rnh_static_nh(si->vrf_id, &nh_p, rn);  	  break; -	case STATIC_IPV6_GATEWAY_IFINDEX: +	case STATIC_IPV6_GATEWAY_IFNAME:  	  nexthop = rib_nexthop_ipv6_ifindex_add (rib, &si->addr.ipv6,  						  si->ifindex);  	  break; @@ -209,7 +209,7 @@ static_nexthop_same (struct nexthop *nexthop, struct static_route *si)        && IPV4_ADDR_SAME (&nexthop->gate.ipv4, &si->addr.ipv4))      return 1;    else if (nexthop->type == NEXTHOP_TYPE_IFINDEX -      && si->type == STATIC_IFINDEX +      && si->type == STATIC_IFNAME        && nexthop->ifindex == si->ifindex)      return 1;    else if (nexthop->type == NEXTHOP_TYPE_IPV6 @@ -217,7 +217,7 @@ static_nexthop_same (struct nexthop *nexthop, struct static_route *si)        && IPV6_ADDR_SAME (&nexthop->gate.ipv6, &si->addr.ipv6))      return 1;    else if (nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX -      && si->type == STATIC_IPV6_GATEWAY_IFINDEX +      && si->type == STATIC_IPV6_GATEWAY_IFNAME        && IPV6_ADDR_SAME (&nexthop->gate.ipv6, &si->addr.ipv6)        && nexthop->ifindex == si->ifindex)      return 1; @@ -359,12 +359,12 @@ static_add_route (afi_t afi, safi_t safi, u_char type, struct prefix *p,    if (!gate &&        (type == STATIC_IPV4_GATEWAY ||         type == STATIC_IPV6_GATEWAY || -       type == STATIC_IPV6_GATEWAY_IFINDEX)) +       type == STATIC_IPV6_GATEWAY_IFNAME))      return -1;    if (!ifindex && -      (type == STATIC_IFINDEX || -       type == STATIC_IPV6_GATEWAY_IFINDEX)) +      (type == STATIC_IFNAME || +       type == STATIC_IPV6_GATEWAY_IFNAME))      return -1;    /* Lookup static route prefix. */ @@ -416,10 +416,10 @@ static_add_route (afi_t afi, safi_t safi, u_char type, struct prefix *p,      case STATIC_IPV6_GATEWAY:        si->addr.ipv6 = gate->ipv6;        break; -    case STATIC_IPV6_GATEWAY_IFINDEX: +    case STATIC_IPV6_GATEWAY_IFNAME:        si->addr.ipv6 = gate->ipv6;        break; -    case STATIC_IFINDEX: +    case STATIC_IFNAME:        break;      } diff --git a/zebra/zebra_static.h b/zebra/zebra_static.h index adc2efff58..1379bef093 100644 --- a/zebra/zebra_static.h +++ b/zebra/zebra_static.h @@ -32,11 +32,11 @@ struct static_nh_label  };  typedef enum { -  STATIC_IFINDEX, +  STATIC_IFNAME,    STATIC_IPV4_GATEWAY,    STATIC_BLACKHOLE,    STATIC_IPV6_GATEWAY, -  STATIC_IPV6_GATEWAY_IFINDEX, +  STATIC_IPV6_GATEWAY_IFNAME,  } zebra_static_types;  /* Static route information. */ @@ -64,7 +64,7 @@ struct static_route     * Under IPv4 addr and ifindex are     * used independentyly.     * STATIC_IPV4_GATEWAY uses addr -   * STATIC_IFINDEX uses ifindex +   * STATIC_IFNAME uses ifindex     */    union g_addr addr;    ifindex_t ifindex; diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index a8bee3cf50..fb00e4d45e 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -193,7 +193,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd,        else          ifindex = ifp->ifindex;        ifname = gate_str; -      type = STATIC_IFINDEX; +      type = STATIC_IFNAME;      }    else      type = STATIC_IPV4_GATEWAY; @@ -2280,7 +2280,7 @@ static_config_ipv4 (struct vty *vty, safi_t safi, const char *cmd)                case STATIC_IPV4_GATEWAY:                  vty_out (vty, " %s", inet_ntoa (si->addr.ipv4));                  break; -              case STATIC_IFINDEX: +              case STATIC_IFNAME:                  vty_out (vty, " %s", si->ifname);                  break;                case STATIC_BLACKHOLE: @@ -2289,7 +2289,7 @@ static_config_ipv4 (struct vty *vty, safi_t safi, const char *cmd)  	      case STATIC_IPV6_GATEWAY:  		vty_out (vty, " %s", inet_ntop (AF_INET6, &si->addr.ipv6, buf, BUFSIZ));  		break; -	      case STATIC_IPV6_GATEWAY_IFINDEX: +	      case STATIC_IPV6_GATEWAY_IFNAME:  		vty_out (vty, " %s %s",  			 inet_ntop (AF_INET6, &si->addr.ipv6, buf, BUFSIZ),  			 ifindex2ifname (si->ifindex, si->vrf_id)); @@ -2457,7 +2457,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,            vty_out (vty, "%% Malformed address%s", VTY_NEWLINE);            return CMD_WARNING;          } -      type = STATIC_IPV6_GATEWAY_IFINDEX; +      type = STATIC_IPV6_GATEWAY_IFNAME;        gate = &gate_addr;        ifp = if_lookup_by_name (ifname, zvrf_id (zvrf));        if (!ifp) @@ -2476,7 +2476,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,          }        else          { -          type = STATIC_IFINDEX; +          type = STATIC_IFNAME;            ifp = if_lookup_by_name (gate_str, zvrf_id (zvrf));            if (!ifp)              { @@ -3773,13 +3773,13 @@ static_config_ipv6 (struct vty *vty)  	      case STATIC_IPV6_GATEWAY:  		vty_out (vty, " %s", inet_ntop (AF_INET6, &si->addr.ipv6, buf, BUFSIZ));  		break; -	      case STATIC_IFINDEX: +	      case STATIC_IFNAME:  		vty_out (vty, " %s", si->ifname);  		break;  	      case STATIC_BLACKHOLE:  		vty_out (vty, " Null0" );  		break; -	      case STATIC_IPV6_GATEWAY_IFINDEX: +	      case STATIC_IPV6_GATEWAY_IFNAME:  		vty_out (vty, " %s %s",  			 inet_ntop (AF_INET6, &si->addr.ipv6, buf, BUFSIZ),  			 ifindex2ifname (si->ifindex, si->vrf_id));  | 
