if (IN6_IS_ADDR_LINKLOCAL (&local->sin6.sin6_addr))
{
if (peer->conf_if || peer->ifname)
- ifp = if_lookup_by_index_vrf (if_nametoindex (peer->conf_if ? peer->conf_if : peer->ifname), peer->bgp->vrf_id);
+ ifp = if_lookup_by_name_vrf (peer->conf_if ? peer->conf_if : peer->ifname, peer->bgp->vrf_id);
}
else if (peer->update_if)
ifp = if_lookup_by_name_vrf (peer->update_if, peer->bgp->vrf_id);
if (!ifindex)
{
if (mpinfo->peer->conf_if || mpinfo->peer->ifname)
- ifindex = if_nametoindex (mpinfo->peer->conf_if ? mpinfo->peer->conf_if : mpinfo->peer->ifname);
+ ifindex = ifname2ifindex (mpinfo->peer->conf_if ? mpinfo->peer->conf_if : mpinfo->peer->ifname);
else if (mpinfo->peer->nexthop.ifp)
ifindex = mpinfo->peer->nexthop.ifp->ifindex;
}
struct zapi_ipv6 api;
assert (info->attr->extra);
-
+
api.vrf_id = peer->bgp->vrf_id;
api.flags = flags;
api.type = ZEBRA_ROUTE_BGP;
{
if (IS_OSPF6_DEBUG_ZEBRA (SEND))
{
- char ifname[IFNAMSIZ];
+ const char *ifname;
inet_ntop (AF_INET6, &nh->address, buf, sizeof (buf));
- if (!if_indextoname(nh->ifindex, ifname))
- strlcpy(ifname, "unknown", sizeof(ifname));
+ ifname = ifindex2ifname (nh->ifindex);
zlog_debug (" nexthop: %s%%%.*s(%d)", buf, IFNAMSIZ, ifname,
nh->ifindex);
}
{
int i;
char destination[PREFIX2STR_BUFFER], nexthop[64];
- char duration[16], ifname[IFNAMSIZ];
+ char duration[16];
+ const char *ifname;
struct timeval now, res;
struct listnode *node;
struct ospf6_nexthop *nh;
else
prefix2str (&route->prefix, destination, sizeof (destination));
-
i = 0;
for (ALL_LIST_ELEMENTS_RO (route->nh_list, node, nh))
{
/* nexthop */
inet_ntop (AF_INET6, &nh->address, nexthop,
sizeof (nexthop));
- if (! if_indextoname (nh->ifindex, ifname))
- snprintf (ifname, sizeof (ifname), "%d", nh->ifindex);
+ ifname = ifindex2ifname (nh->ifindex);
if (!i)
{
void
ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route)
{
- char destination[PREFIX2STR_BUFFER], nexthop[64], ifname[IFNAMSIZ];
+ const char *ifname;
+ char destination[PREFIX2STR_BUFFER], nexthop[64];
char area_id[16], id[16], adv_router[16], capa[16], options[16];
struct timeval now, res;
char duration[16];
{
/* nexthop */
inet_ntop (AF_INET6, &nh->address, nexthop, sizeof (nexthop));
- if (! if_indextoname (nh->ifindex, ifname))
- snprintf (ifname, sizeof (ifname), "%d", nh->ifindex);
+ ifname = ifindex2ifname (nh->ifindex);
vty_out (vty, " %s %.*s%s", nexthop, IFNAMSIZ, ifname, VNL);
}
vty_out (vty, "%s", VNL);