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>
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index 9765096..7059e8a 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -402,7 +402,7 @@
#ifdef HAVE_IPV6
if (peer->ifname)
- ifindex = if_nametoindex (peer->ifname);
+ ifindex = ifname2ifindex (peer->ifname);
#endif /* HAVE_IPV6 */
if (BGP_DEBUG (events, EVENTS))