diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-09-03 18:19:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-04 14:53:21 -0400 |
commit | cc7f7ab758f66a9110c8e737c3de3e9f5fc209b5 (patch) | |
tree | 7e47e57a77f9d0164fc085b06a2fe71bddf696e7 /net | |
parent | 58c0ecfd8d9871cfa35bcdbf3e7b3ee9ca62ea67 (diff) |
net: ipv6: mld: similarly to MLDv2 have min max_delay of 1
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>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/mcast.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index c916568d838a..beb76b7989a7 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) | |||
1040 | delay = ma->mca_timer.expires - jiffies; | 1040 | delay = ma->mca_timer.expires - jiffies; |
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | if (delay >= resptime) { | 1043 | if (delay >= resptime) |
1044 | if (resptime) | 1044 | delay = net_random() % resptime; |
1045 | delay = net_random() % resptime; | 1045 | |
1046 | else | ||
1047 | delay = 1; | ||
1048 | } | ||
1049 | ma->mca_timer.expires = jiffies + delay; | 1046 | ma->mca_timer.expires = jiffies + delay; |
1050 | if (!mod_timer(&ma->mca_timer, jiffies + delay)) | 1047 | if (!mod_timer(&ma->mca_timer, jiffies + delay)) |
1051 | atomic_inc(&ma->mca_refcnt); | 1048 | atomic_inc(&ma->mca_refcnt); |
@@ -1258,12 +1255,15 @@ int igmp6_event_query(struct sk_buff *skb) | |||
1258 | return -EINVAL; | 1255 | return -EINVAL; |
1259 | 1256 | ||
1260 | if (len == MLD_V1_QUERY_LEN) { | 1257 | if (len == MLD_V1_QUERY_LEN) { |
1258 | unsigned long mldv1_md; | ||
1259 | |||
1261 | /* Ignore v1 queries */ | 1260 | /* Ignore v1 queries */ |
1262 | if (mld_in_v2_mode_only(idev)) | 1261 | if (mld_in_v2_mode_only(idev)) |
1263 | return 0; | 1262 | return 0; |
1264 | 1263 | ||
1265 | /* MLDv1 router present */ | 1264 | /* MLDv1 router present */ |
1266 | max_delay = msecs_to_jiffies(ntohs(mld->mld_maxdelay)); | 1265 | mldv1_md = ntohs(mld->mld_maxdelay); |
1266 | max_delay = max(msecs_to_jiffies(mldv1_md), 1UL); | ||
1267 | 1267 | ||
1268 | mld_set_v1_mode(idev); | 1268 | mld_set_v1_mode(idev); |
1269 | 1269 | ||