diff options
Diffstat (limited to 'pimd/pim_iface.c')
| -rw-r--r-- | pimd/pim_iface.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index 14c8c7262e..a8a1d08805 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -41,19 +41,6 @@ #include "pim_time.h" #include "pim_ssmpingd.h" -#ifndef VIFF_USE_IFINDEX -# ifdef linux -/* make it work compile-time - whether it works runtime depends on the user - * having 2.6.32 or newer */ -# define VIFF_USE_IFINDEX 0x8 -# else -# error no VIFF_USE_IFINDEX on this system, code needs porting -/* NB: without VIFF_USE_IFINDEX, the local IP address is used to identify - * interfaces, which means it's impossible to support multiple interfaces that - * have the same or no IP address (e.g. unnumbered) */ -# endif -#endif - struct interface *pim_regiface = NULL; static void pim_if_igmp_join_del_all(struct interface *ifp); @@ -645,7 +632,7 @@ int pim_if_add_vif(struct interface *ifp) { struct pim_interface *pim_ifp = ifp->info; struct in_addr ifaddr; - unsigned char flags; + unsigned char flags = 0; zassert(pim_ifp); @@ -681,8 +668,13 @@ int pim_if_add_vif(struct interface *ifp) return -3; } - flags = (ifp->ifindex == PIM_OIF_PIM_REGISTER_VIF) ? - VIFF_REGISTER : VIFF_USE_IFINDEX; + if (ifp->ifindex == PIM_OIF_PIM_REGISTER_VIF) + flags = VIFF_REGISTER; +#ifdef VIFF_USE_IFINDEX + else + flags = VIFF_USE_IFINDEX; +#endif + if (pim_mroute_add_vif(ifp, ifaddr, flags)) { /* pim_mroute_add_vif reported error */ return -5; @@ -780,7 +772,7 @@ void pim_if_del_vif_all() } } -struct interface *pim_if_find_by_vif_index(int vif_index) +struct interface *pim_if_find_by_vif_index(ifindex_t vif_index) { struct listnode *ifnode; struct interface *ifp; @@ -792,6 +784,7 @@ struct interface *pim_if_find_by_vif_index(int vif_index) if (ifp->info) { struct pim_interface *pim_ifp; pim_ifp = ifp->info; + if (vif_index == pim_ifp->mroute_vif_index) return ifp; } @@ -803,7 +796,7 @@ struct interface *pim_if_find_by_vif_index(int vif_index) /* pim_if_add_vif() uses ifindex as vif_index */ -int pim_if_find_vifindex_by_ifindex(int ifindex) +int pim_if_find_vifindex_by_ifindex(ifindex_t ifindex) { struct pim_interface *pim_ifp; struct interface *ifp; @@ -962,7 +955,7 @@ static struct igmp_join *igmp_join_find(struct list *join_list, } static int igmp_join_sock(const char *ifname, - int ifindex, + ifindex_t ifindex, struct in_addr group_addr, struct in_addr source_addr) { |
