diff options
author | Feng Lu <lu.feng@6wind.com> | 2015-05-22 11:39:55 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2015-06-02 06:58:12 +0200 |
commit | 395828eea809e8b2b8c5824d3639cefedd7aa9f0 (patch) | |
tree | 61341d0667a67d8645455fad7029cc916eb9a3e2 /ospf6d/ospf6_zebra.c | |
parent | be6335d682c5ee1b6930345193eda875705fbab2 (diff) | |
download | quagga-395828eea809e8b2b8c5824d3639cefedd7aa9f0.tar.bz2 quagga-395828eea809e8b2b8c5824d3639cefedd7aa9f0.tar.xz |
ospf6d, bgpd: avoid calling if_nametoindex
As the comments in if.h, it is better to call ifname2ifindex()
instead of if_nametoindex().
And ifname2ifindex() can work for VRF by appending a parameter
while if_nametoindex() can not.
Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_zebra.c')
-rw-r--r-- | ospf6d/ospf6_zebra.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 85f70647..ac3235c4 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -443,11 +443,10 @@ ospf6_zebra_route_update (int type, struct ospf6_route *request) { if (IS_OSPF6_DEBUG_ZEBRA (SEND)) { - char ifname[IFNAMSIZ]; + const char *ifname; inet_ntop (AF_INET6, &request->nexthop[i].address, buf, sizeof (buf)); - if (!if_indextoname(request->nexthop[i].ifindex, ifname)) - strlcpy(ifname, "unknown", sizeof(ifname)); + ifname = ifindex2ifname (request->nexthop[i].ifindex); zlog_debug (" nexthop: %s%%%.*s(%d)", buf, IFNAMSIZ, ifname, request->nexthop[i].ifindex); } |