#include "memory.h"
#include "prefix.h"
#include "vrf.h"
+#include "linklist.h"
#include "pimd.h"
#include "pim_iface.h"
return 0;
}
+
+struct interface *
+pim_if_lookup_address_vrf (struct in_addr src, vrf_id_t vrf_id)
+{
+ struct listnode *ifnode;
+ struct interface *ifp;
+
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist(vrf_id), ifnode, ifp))
+ {
+ if (pim_if_connected_to_source (ifp, src) && ifp->info)
+ return ifp;
+ }
+ return NULL;
+}
void pim_if_addr_del_all_igmp(struct interface *ifp);
void pim_if_addr_del_all_pim(struct interface *ifp);
+struct interface *pim_if_lookup_address_vrf (struct in_addr src, vrf_id_t vrf_id);
+
int pim_if_add_vif(struct interface *ifp);
int pim_if_del_vif(struct interface *ifp);
void pim_if_add_vif_all(void);
* received on. Find the interface that is on the same subnet as the source
* of the IP packet.
*/
- ifp = if_lookup_address_vrf((void *) &ip_hdr->ip_src, AF_INET, VRF_DEFAULT);
+ ifp = pim_if_lookup_address_vrf (ip_hdr->ip_src, VRF_DEFAULT);
if (!ifp) {
if (PIM_DEBUG_MROUTE_DETAIL) {
pim_inet4_dump("<src?>", ip_hdr->ip_src, ip_src_str, sizeof(ip_src_str));
pim_inet4_dump("<dst?>", ip_hdr->ip_dst, ip_dst_str, sizeof(ip_dst_str));
- zlog_warn("%s: igmp kernel upcall could not find interface for %s -> %s",
+ zlog_warn("%s: igmp kernel upcall could not find usable interface for %s -> %s",
__PRETTY_FUNCTION__,
ip_src_str,
ip_dst_str);
}
return 0;
}
-
pim_ifp = ifp->info;
- if (!pim_ifp)
- {
- if (PIM_DEBUG_MROUTE_DETAIL)
- zlog_debug ("%s: igmp kernel upcall for interface:%s not configured for pim",
- __PRETTY_FUNCTION__, ifp->name);
- return 0;
- }
-
ifaddr = pim_find_primary_addr(ifp);
igmp = pim_igmp_sock_lookup_ifaddr(pim_ifp->igmp_socket_list, ifaddr);