summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2015-12-01 11:17:41 +0000
committerae <ae@FreeBSD.org>2015-12-01 11:17:41 +0000
commite9c29fe907344cd565f7e8f2832e95635828d927 (patch)
tree6238265fc59c3e216e446192ae228e8311c03568 /sys/netinet6
parent0ec5645cbe90cf462d93e00df0d30e7760eb3b1c (diff)
downloadFreeBSD-src-e9c29fe907344cd565f7e8f2832e95635828d927.zip
FreeBSD-src-e9c29fe907344cd565f7e8f2832e95635828d927.tar.gz
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 MFC after: 1 week Sponsored by: Yandex LLC
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/mld6.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index 615fb19..3c4cc99 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);
/*
OpenPOWER on IntegriCloud