Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Dec 2015 07:36:26 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r291988 - stable/9/sys/netinet6
Message-ID:  <201512080736.tB87aQub075854@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Tue Dec  8 07:36:26 2015
New Revision: 291988
URL: https://svnweb.freebsd.org/changeset/base/291988

Log:
  MFC r291578:
    mld_v2_dispatch_general_query() is used by mld_fasttimo_vnet() to send
    a reply to the MLDv2 General Query. In case when router has a lot of
    multicast groups, the reply can take several packets due to MTU limitation.
    Also we have a limit MLD_MAX_RESPONSE_BURST == 4, that limits the number
    of packets we send in one shot. Then we recalculate the timer value and
    schedule the remaining packets for sending.
    The problem is that when we call mld_v2_dispatch_general_query() to send
    remaining packets, we queue new reply in the same mbuf queue. And when
    number of packets is bigger than MLD_MAX_RESPONSE_BURST, we get endless
    reply of MLDv2 reports.
    To fix this, add the check for remaining packets in the queue.
  
    PR:		204831

Modified:
  stable/9/sys/netinet6/mld6.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet6/mld6.c
==============================================================================
--- stable/9/sys/netinet6/mld6.c	Tue Dec  8 07:31:26 2015	(r291987)
+++ stable/9/sys/netinet6/mld6.c	Tue Dec  8 07:36:26 2015	(r291988)
@@ -2989,6 +2989,15 @@ mld_v2_dispatch_general_query(struct mld
 	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 (mli->mli_gq.ifq_head != NULL)
+		goto send;
+
 	ifp = mli->mli_ifp;
 
 	IF_ADDR_RLOCK(ifp);
@@ -3024,6 +3033,7 @@ mld_v2_dispatch_general_query(struct mld
 	}
 	IF_ADDR_RUNLOCK(ifp);
 
+send:
 	mld_dispatch_queue(&mli->mli_gq, MLD_MAX_RESPONSE_BURST);
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512080736.tB87aQub075854>