From: Daniel Borkmann <dborkman@redhat.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org,
Hannes Frederic Sowa <hannes@stressinduktion.org>
Subject: [RFC PATCH net-next 6/7] net: ipv6: mld: similarly to MLDv2 have min max_delay of 1
Date: Fri, 30 Aug 2013 18:58:27 +0200 [thread overview]
Message-ID: <1377881908-8022-7-git-send-email-dborkman@redhat.com> (raw)
In-Reply-To: <1377881908-8022-1-git-send-email-dborkman@redhat.com>
Similarly as we do in MLDv2 queries, set a forged MLDv1 query with
0 ms mld_maxdelay to minimum timer shot time of 1 jiffies. This is
eventually done in igmp6_group_queried() anyway, so we can simplify
a check there.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/ipv6/mcast.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index d6f2809..be22317 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1040,12 +1040,9 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime)
delay = ma->mca_timer.expires - jiffies;
}
- if (delay >= resptime) {
- if (resptime)
- delay = net_random() % resptime;
- else
- delay = 1;
- }
+ if (delay >= resptime)
+ delay = net_random() % resptime;
+
ma->mca_timer.expires = jiffies + delay;
if (!mod_timer(&ma->mca_timer, jiffies + delay))
atomic_inc(&ma->mca_refcnt);
@@ -1247,12 +1244,15 @@ int igmp6_event_query(struct sk_buff *skb)
return -EINVAL;
if (len == MLD_V1_QUERY_LEN) {
+ unsigned long mldv1_md;
+
/* Ignore v1 queries */
if (mld_in_v2_mode_only(idev))
return 0;
/* MLDv1 router present */
- max_delay = msecs_to_jiffies(ntohs(mld->mld_maxdelay));
+ mldv1_md = ntohs(mld->mld_maxdelay);
+ max_delay = max(msecs_to_jiffies(mldv1_md), 1UL);
mld_set_v1_mode(idev);
--
1.7.11.7
next prev parent reply other threads:[~2013-08-30 16:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-30 16:58 [RFC PATCH net-next 0/7] IPv6 MLD updates Daniel Borkmann
2013-08-30 16:58 ` [RFC PATCH net-next 1/7] net: ipv6: mld: fix v1/v2 switchback timeout to rfc3810, 9.12 Daniel Borkmann
2013-08-30 16:58 ` [RFC PATCH net-next 2/7] net: ipv6: mld: clean up MLD_V1_SEEN macro Daniel Borkmann
2013-08-30 16:58 ` [RFC PATCH net-next 3/7] net: ipv6: mld: get rid of MLDV2_MRC and simplify calculation Daniel Borkmann
2013-08-30 16:58 ` [RFC PATCH net-next 4/7] net: ipv6: mld: implement RFC3810 MLDv2 mode only Daniel Borkmann
2013-08-30 16:58 ` [RFC PATCH net-next 5/7] net: ipv6: mld: restrict min/max of sysctl force_mld_version Daniel Borkmann
2013-08-30 16:58 ` Daniel Borkmann [this message]
2013-08-30 16:58 ` [RFC PATCH net-next 7/7] net: ipv6: mld: document force_mld_version in ip-sysctl.txt Daniel Borkmann
2013-08-30 18:38 ` [RFC PATCH net-next 0/7] IPv6 MLD updates David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1377881908-8022-7-git-send-email-dborkman@redhat.com \
--to=dborkman@redhat.com \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).