#endif
static struct router_info *
- find_rti(struct ifnet *ifp);
+ find_rti(struct ifnet *ifp, int wait);
static struct igmpstat igmpstat;
static struct router_info *
find_rti(
- struct ifnet *ifp)
+ struct ifnet *ifp, int wait)
{
struct router_info *rti = Head;
rti = rti->rti_next;
}
- MALLOC(rti, struct router_info *, sizeof *rti, M_IGMP, M_NOWAIT);
+ MALLOC(rti, struct router_info *, sizeof *rti, M_IGMP, wait);
if (rti != NULL)
{
rti->rti_ifp = ifp;
timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE;
if (timer == 0)
timer = 1;
- rti = find_rti(ifp);
+ rti = find_rti(ifp, M_NOWAIT);
if (rti == NULL) {
m_freem(m);
return;
inm->inm_timer = 0;
inm->inm_state = IGMP_OTHERMEMBER;
} else {
- inm->inm_rti = find_rti(inm->inm_ifp);
+ inm->inm_rti = find_rti(inm->inm_ifp, M_WAITOK);
if (inm->inm_rti == NULL) return ENOMEM;
igmp_sendpkt(inm, inm->inm_rti->rti_type, 0);
inm->inm_timer = IGMP_RANDOM_DELAY(
while (inm != NULL) {
if (inm->inm_timer == 0) {
/* do nothing */
- } else if (--inm->inm_timer == 0) {
+ } else if ((--inm->inm_timer == 0) && (inm->inm_rti != NULL)) {
igmp_sendpkt(inm, inm->inm_rti->rti_type, 0);
inm->inm_state = IGMP_IREPORTEDLAST;
} else {