FreeBSD/sys/netinet6/mld6.c
/*
 * Cancel pending MLDv2 timers for the given link and all groups
 * joined on it; state-change, general-query, and group-query timers.
 */
Cancel pending MLDv2 timers for the given link and all groups
joined on it; state-change, general-query, and group-query timers.
Cancel pending MLDv2 timers for the given link and all groups joined on it ; state - change general - query and group - query timers .
static void
mld_v2_cancel_link_timers(struct mld_ifsoftc *mli)
{
	struct ifmultiaddr	*ifma;
	struct ifnet		*ifp;
	struct in6_multi	*inm, *tinm;
	CTR3(KTR_MLD, "%s: cancel v2 timers on ifp %p(%s)", __func__,
	    mli->mli_ifp, if_name(mli->mli_ifp));
	IN6_MULTI_LOCK_ASSERT();
	MLD_LOCK_ASSERT();
	if (!V_interface_timers_running6 &&
	    !V_state_change_timers_running6 &&
	    !V_current_state_timers_running6)
		return;
	mli->mli_v2_timer = 0;
	ifp = mli->mli_ifp;
	IF_ADDR_RLOCK(ifp);
	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
		if (ifma->ifma_addr->sa_family != AF_INET6)
			continue;
		inm = (struct in6_multi *)ifma->ifma_protospec;
		switch (inm->in6m_state) {
		case MLD_NOT_MEMBER:
		case MLD_SILENT_MEMBER:
		case MLD_IDLE_MEMBER:
		case MLD_LAZY_MEMBER:
		case MLD_SLEEPING_MEMBER:
		case MLD_AWAKENING_MEMBER:
			break;
		case MLD_LEAVING_MEMBER:
			SLIST_INSERT_HEAD(&mli->mli_relinmhead, inm,
			    in6m_nrele);
		case MLD_G_QUERY_PENDING_MEMBER:
		case MLD_SG_QUERY_PENDING_MEMBER:
			in6m_clear_recorded(inm);
		case MLD_REPORTING_MEMBER:
			inm->in6m_sctimer = 0;
			inm->in6m_timer = 0;
			inm->in6m_state = MLD_REPORTING_MEMBER;
			mbufq_drain(&inm->in6m_scq);
			break;
		}
	}
	IF_ADDR_RUNLOCK(ifp);
	SLIST_FOREACH_SAFE(inm, &mli->mli_relinmhead, in6m_nrele, tinm) {
		SLIST_REMOVE_HEAD(&mli->mli_relinmhead, in6m_nrele);
		in6m_release_locked(inm);
	}
}
static void mld_v2_cancel_link_timers ( struct mld_ifsoftc * mli ) { struct ifmultiaddr * ifma ; struct ifnet * ifp ; struct in6_multi * inm , * tinm ; CTR3 ( KTR_MLD , " " , __func__ , mli -> mli_ifp , if_name ( mli -> mli_ifp ) ) ; IN6_MULTI_LOCK_ASSERT ( ) ; MLD_LOCK_ASSERT ( ) ; if ( ! V_interface_timers_running6 && ! V_state_change_timers_running6 && ! V_current_state_timers_running6 ) return ; mli -> mli_v2_timer = 0 ; ifp = mli -> mli_ifp ; IF_ADDR_RLOCK ( ifp ) ; TAILQ_FOREACH ( ifma , & ifp -> if_multiaddrs , ifma_link ) { if ( ifma -> ifma_addr -> sa_family != AF_INET6 ) continue ; inm = ( struct in6_multi * ) ifma -> ifma_protospec ; switch ( inm -> in6m_state ) { case MLD_NOT_MEMBER : case MLD_SILENT_MEMBER : case MLD_IDLE_MEMBER : case MLD_LAZY_MEMBER : case MLD_SLEEPING_MEMBER : case MLD_AWAKENING_MEMBER : break ; case MLD_LEAVING_MEMBER : SLIST_INSERT_HEAD ( & mli -> mli_relinmhead , inm , in6m_nrele ) ; case MLD_G_QUERY_PENDING_MEMBER : case MLD_SG_QUERY_PENDING_MEMBER : in6m_clear_recorded ( inm ) ; case MLD_REPORTING_MEMBER : inm -> in6m_sctimer = 0 ; inm -> in6m_timer = 0 ; inm -> in6m_state = MLD_REPORTING_MEMBER ; mbufq_drain ( & inm -> in6m_scq ) ; break ; } } IF_ADDR_RUNLOCK ( ifp ) ; SLIST_FOREACH_SAFE ( inm , & mli -> mli_relinmhead , in6m_nrele , tinm ) { SLIST_REMOVE_HEAD ( & mli -> mli_relinmhead , in6m_nrele ) ; in6m_release_locked ( inm ) ; } }
Cancel pending MLDv2 timers for the given link and all groups
 joined on it; state-change, general-query, and group-query timers.
Cancel pending MLDv2 timers for the given link and all groups joined on it ; state - change general - query and group - query timers .
/*
	 * Fast-track this potentially expensive operation
	 * by checking all the global 'timer pending' flags.
	 */ /*
			 * If we are leaving the group and switching
			 * version, we need to release the final
			 * reference held for issuing the INCLUDE {}.
			 */ /* FALLTHROUGH */ /* FALLTHROUGH */ /*
			 * Free any pending MLDv2 state-change records.
			 */