summaryrefslogtreecommitdiff
path: root/sys/netinet/igmp.c
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2015-12-01 11:24:30 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2015-12-01 11:24:30 +0000
commitb4e63e2d15e9aea3da2537e2060041fd21a1e4cb (patch)
tree4dee3bc4950d219da7cf0e75d916c9efbfa632e5 /sys/netinet/igmp.c
parent9f8b8e793bfa387a7104be00c7ff1462a72aa6d6 (diff)
downloadsrc-test2-b4e63e2d15e9aea3da2537e2060041fd21a1e4cb.tar.gz
src-test2-b4e63e2d15e9aea3da2537e2060041fd21a1e4cb.zip
Notes
Diffstat (limited to 'sys/netinet/igmp.c')
-rw-r--r--sys/netinet/igmp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index 185f5c2b5a04..d83348c758ed 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -3334,6 +3334,15 @@ igmp_v3_dispatch_general_query(struct igmp_ifsoftc *igi)
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 igmp_ifsoftc *igi)
}
IF_ADDR_RUNLOCK(ifp);
+send:
loop = (igi->igi_flags & IGIF_LOOPBACK) ? 1 : 0;
igmp_dispatch_queue(&igi->igi_gq, IGMP_MAX_RESPONSE_BURST, loop);