MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mld_v2_dispatch_general_query

Function mld_v2_dispatch_general_query

freebsd/netinet6/mld6.c:3007–3073  ·  view source on GitHub ↗

* Respond to a pending MLDv2 General Query. */

Source from the content-addressed store, hash-verified

3005 * Respond to a pending MLDv2 General Query.
3006 */
3007static void
3008mld_v2_dispatch_general_query(struct mld_ifsoftc *mli)
3009{
3010 struct ifmultiaddr *ifma;
3011 struct ifnet *ifp;
3012 struct in6_multi *inm;
3013 int retval;
3014
3015 NET_EPOCH_ASSERT();
3016 IN6_MULTI_LIST_LOCK_ASSERT();
3017 MLD_LOCK_ASSERT();
3018
3019 KASSERT(mli->mli_version == MLD_VERSION_2,
3020 ("%s: called when version %d", __func__, mli->mli_version));
3021
3022 /*
3023 * Check that there are some packets queued. If so, send them first.
3024 * For large number of groups the reply to general query can take
3025 * many packets, we should finish sending them before starting of
3026 * queuing the new reply.
3027 */
3028 if (mbufq_len(&mli->mli_gq) != 0)
3029 goto send;
3030
3031 ifp = mli->mli_ifp;
3032
3033 CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
3034 inm = in6m_ifmultiaddr_get_inm(ifma);
3035 if (inm == NULL)
3036 continue;
3037 KASSERT(ifp == inm->in6m_ifp,
3038 ("%s: inconsistent ifp", __func__));
3039
3040 switch (inm->in6m_state) {
3041 case MLD_NOT_MEMBER:
3042 case MLD_SILENT_MEMBER:
3043 break;
3044 case MLD_REPORTING_MEMBER:
3045 case MLD_IDLE_MEMBER:
3046 case MLD_LAZY_MEMBER:
3047 case MLD_SLEEPING_MEMBER:
3048 case MLD_AWAKENING_MEMBER:
3049 inm->in6m_state = MLD_REPORTING_MEMBER;
3050 retval = mld_v2_enqueue_group_record(&mli->mli_gq,
3051 inm, 0, 0, 0, 0);
3052 CTR2(KTR_MLD, "%s: enqueue record = %d",
3053 __func__, retval);
3054 break;
3055 case MLD_G_QUERY_PENDING_MEMBER:
3056 case MLD_SG_QUERY_PENDING_MEMBER:
3057 case MLD_LEAVING_MEMBER:
3058 break;
3059 }
3060 }
3061
3062send:
3063 mld_dispatch_queue(&mli->mli_gq, MLD_MAX_RESPONSE_BURST);
3064

Callers 1

mld_fasttimo_vnetFunction · 0.85

Calls 5

mld_dispatch_queueFunction · 0.85
in6m_ifmultiaddr_get_inmFunction · 0.70
mbufq_lenFunction · 0.50
mbufq_firstFunction · 0.50

Tested by

no test coverage detected