diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 615fb19a923..3c4cc99f1a5 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -2985,6 +2985,15 @@ mld_v2_dispatch_general_query(struct mld_ifsoftc *mli) KASSERT(mli->mli_version == MLD_VERSION_2, ("%s: called when version %d", __func__, mli->mli_version)); + /* + * Check that there are some packets queued. If so, send them first. + * For large number of groups the reply to general query can take + * many packets, we should finish sending them before starting of + * queuing the new reply. + */ + if (mbufq_len(&mli->mli_gq) != 0) + goto send; + ifp = mli->mli_ifp; IF_ADDR_RLOCK(ifp); @@ -3020,6 +3029,7 @@ mld_v2_dispatch_general_query(struct mld_ifsoftc *mli) } IF_ADDR_RUNLOCK(ifp); +send: mld_dispatch_queue(&mli->mli_gq, MLD_MAX_RESPONSE_BURST); /*