Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Dec 2015 11:24:30 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r291579 - head/sys/netinet
Message-ID:  <201512011124.tB1BOUFU017137@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Tue Dec  1 11:24:30 2015
New Revision: 291579
URL: https://svnweb.freebsd.org/changeset/base/291579

Log:
  In the same way fix the problem described in r291578 for IGMPv3.
  
  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 IGMP_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 igmp_v3_dispatch_general_query() to send
  remaining packets, we queue new reply in the same mbuf queue. And when
  number of packets is bigger than IGMP_MAX_RESPONSE_BURST, we get endless
  reply of IGMPv3 reports.
  To fix this, add the check for remaining packets in the queue.
  
  MFC after:	1 week
  Sponsored by:	Yandex LLC

Modified:
  head/sys/netinet/igmp.c

Modified: head/sys/netinet/igmp.c
==============================================================================
--- head/sys/netinet/igmp.c	Tue Dec  1 11:17:41 2015	(r291578)
+++ head/sys/netinet/igmp.c	Tue Dec  1 11:24:30 2015	(r291579)
@@ -3334,6 +3334,15 @@ igmp_v3_dispatch_general_query(struct ig
 	KASSERT(igi->igi_version == IGMP_VERSION_3,
 	    ("%s: called when version %d", __func__, igi->igi_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(&igi->igi_gq) != 0)
+		goto send;
+
 	ifp = igi->igi_ifp;
 
 	IF_ADDR_RLOCK(ifp);
@@ -3369,6 +3378,7 @@ igmp_v3_dispatch_general_query(struct ig
 	}
 	IF_ADDR_RUNLOCK(ifp);
 
+send:
 	loop = (igi->igi_flags & IGIF_LOOPBACK) ? 1 : 0;
 	igmp_dispatch_queue(&igi->igi_gq, IGMP_MAX_RESPONSE_BURST, loop);
 



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