summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorHangbin Liu <liuhangbin@gmail.com>2018-08-29 18:06:08 +0800
committerBen Hutchings <ben@decadent.org.uk>2018-12-16 22:08:59 +0000
commit79c9f22b1ee1b511b87d12e6c075fc58c388d8e9 (patch)
tree0a7c994b57075ef77511fccfcdaf07bade07394e /net/ipv4
parentb1621dc93979be99046133a4b0415af0fe946b05 (diff)
downloadlinux-stable-79c9f22b1ee1b511b87d12e6c075fc58c388d8e9.tar.gz
linux-stable-79c9f22b1ee1b511b87d12e6c075fc58c388d8e9.tar.bz2
linux-stable-79c9f22b1ee1b511b87d12e6c075fc58c388d8e9.zip
igmp: fix incorrect unsolicit report count when join group
commit 4fb7253e4f9a8f06a986a3b317e2f79d9b43d552 upstream. We should not start timer if im->unsolicit_count equal to 0 after decrease. Or we will send one more unsolicit report message. i.e. 3 instead of 2 by default. Fixes: 1da177e4c3f41 ("Linux-2.6.12-rc2") Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/igmp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 08dfaeac1b08..5f7d0ef9aaaf 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -795,10 +795,9 @@ static void igmp_timer_expire(unsigned long data)
spin_lock(&im->lock);
im->tm_running = 0;
- if (im->unsolicit_count) {
- im->unsolicit_count--;
+ if (im->unsolicit_count && --im->unsolicit_count)
igmp_start_timer(im, unsolicited_report_interval(in_dev));
- }
+
im->reporter = 1;
spin_unlock(&im->lock);