FreeBSD/sys/netinet6/mld6.c
/*
 * Issue an intermediate state change during the life-cycle.
 */
Issue an intermediate state change during the life-cycle.
Issue an intermediate state change during the life - cycle .
static int
mld_handle_state_change(struct in6_multi *inm, struct mld_ifsoftc *mli)
{
	struct ifnet		*ifp;
	int			 retval;
#ifdef KTR
	char			 ip6tbuf[INET6_ADDRSTRLEN];
#endif
	CTR4(KTR_MLD, "%s: state change for %s on ifp %p(%s)",
	    __func__, ip6_sprintf(ip6tbuf, &inm->in6m_addr),
	    inm->in6m_ifp, if_name(inm->in6m_ifp));
	ifp = inm->in6m_ifp;
	IN6_MULTI_LOCK_ASSERT();
	MLD_LOCK_ASSERT();
	KASSERT(mli && mli->mli_ifp == ifp,
	    ("%s: inconsistent ifp", __func__));
	if ((ifp->if_flags & IFF_LOOPBACK) ||
	    (mli->mli_flags & MLIF_SILENT) ||
	    !mld_is_addr_reported(&inm->in6m_addr) ||
	    (mli->mli_version != MLD_VERSION_2)) {
		if (!mld_is_addr_reported(&inm->in6m_addr)) {
			CTR1(KTR_MLD,
"%s: not kicking state machine for silent group", __func__);
		}
		CTR1(KTR_MLD, "%s: nothing to do", __func__);
		in6m_commit(inm);
		CTR3(KTR_MLD, "%s: T1 -> T0 for %s/%s", __func__,
		    ip6_sprintf(ip6tbuf, &inm->in6m_addr),
		    if_name(inm->in6m_ifp));
		return (0);
	}
	mbufq_drain(&inm->in6m_scq);
	retval = mld_v2_enqueue_group_record(&inm->in6m_scq, inm, 1, 0, 0,
	    (mli->mli_flags & MLIF_USEALLOW));
	CTR2(KTR_MLD, "%s: enqueue record = %d", __func__, retval);
	if (retval <= 0)
		return (-retval);
	inm->in6m_scrv = mli->mli_rv;
	inm->in6m_sctimer = 1;
	V_state_change_timers_running6 = 1;
	return (0);
}
static int mld_handle_state_change ( struct in6_multi * inm , struct mld_ifsoftc * mli ) { struct ifnet * ifp ; int retval ; #ifdef KTR char ip6tbuf [ INET6_ADDRSTRLEN ] ; #endif CTR4 ( KTR_MLD , " " , __func__ , ip6_sprintf ( ip6tbuf , & inm -> in6m_addr ) , inm -> in6m_ifp , if_name ( inm -> in6m_ifp ) ) ; ifp = inm -> in6m_ifp ; IN6_MULTI_LOCK_ASSERT ( ) ; MLD_LOCK_ASSERT ( ) ; KASSERT ( mli && mli -> mli_ifp == ifp , ( " " , __func__ ) ) ; if ( ( ifp -> if_flags & IFF_LOOPBACK ) || ( mli -> mli_flags & MLIF_SILENT ) || ! mld_is_addr_reported ( & inm -> in6m_addr ) || ( mli -> mli_version != MLD_VERSION_2 ) ) { if ( ! mld_is_addr_reported ( & inm -> in6m_addr ) ) { CTR1 ( KTR_MLD , " " , __func__ ) ; } CTR1 ( KTR_MLD , " " , __func__ ) ; in6m_commit ( inm ) ; CTR3 ( KTR_MLD , " " , __func__ , ip6_sprintf ( ip6tbuf , & inm -> in6m_addr ) , if_name ( inm -> in6m_ifp ) ) ; return ( 0 ) ; } mbufq_drain ( & inm -> in6m_scq ) ; retval = mld_v2_enqueue_group_record ( & inm -> in6m_scq , inm , 1 , 0 , 0 , ( mli -> mli_flags & MLIF_USEALLOW ) ) ; CTR2 ( KTR_MLD , " " , __func__ , retval ) ; if ( retval <= 0 ) return ( - retval ) ; inm -> in6m_scrv = mli -> mli_rv ; inm -> in6m_sctimer = 1 ; V_state_change_timers_running6 = 1 ; return ( 0 ) ; }
Issue an intermediate state change during the life-cycle.
Issue an intermediate state change during the life - cycle .
/*
	 * If record(s) were enqueued, start the state-change
	 * report timer for this group.
	 */