Commit cc7f7ab7 authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller

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: default avatarDaniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58c0ecfd
...@@ -1040,12 +1040,9 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime) ...@@ -1040,12 +1040,9 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime)
delay = ma->mca_timer.expires - jiffies; delay = ma->mca_timer.expires - jiffies;
} }
if (delay >= resptime) { if (delay >= resptime)
if (resptime)
delay = net_random() % resptime; delay = net_random() % resptime;
else
delay = 1;
}
ma->mca_timer.expires = jiffies + delay; ma->mca_timer.expires = jiffies + delay;
if (!mod_timer(&ma->mca_timer, jiffies + delay)) if (!mod_timer(&ma->mca_timer, jiffies + delay))
atomic_inc(&ma->mca_refcnt); atomic_inc(&ma->mca_refcnt);
...@@ -1258,12 +1255,15 @@ int igmp6_event_query(struct sk_buff *skb) ...@@ -1258,12 +1255,15 @@ int igmp6_event_query(struct sk_buff *skb)
return -EINVAL; return -EINVAL;
if (len == MLD_V1_QUERY_LEN) { if (len == MLD_V1_QUERY_LEN) {
unsigned long mldv1_md;
/* Ignore v1 queries */ /* Ignore v1 queries */
if (mld_in_v2_mode_only(idev)) if (mld_in_v2_mode_only(idev))
return 0; return 0;
/* MLDv1 router present */ /* 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); mld_set_v1_mode(idev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment