From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hangbin Liu Subject: [PATCH net 1/2] igmp: fix incorrect unsolicit report count when join group Date: Wed, 29 Aug 2018 18:06:09 +0800 Message-ID: <1535537171-24533-3-git-send-email-liuhangbin@gmail.com> References: <1535537171-24533-1-git-send-email-liuhangbin@gmail.com> Cc: David Miller , Hangbin Liu To: netdev@vger.kernel.org Return-path: Received: from mail-pl1-f196.google.com ([209.85.214.196]:35791 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726858AbeH2ODI (ORCPT ); Wed, 29 Aug 2018 10:03:08 -0400 Received: by mail-pl1-f196.google.com with SMTP id d9-v6so2085955plr.2 for ; Wed, 29 Aug 2018 03:07:00 -0700 (PDT) In-Reply-To: <1535537171-24533-1-git-send-email-liuhangbin@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- net/ipv4/igmp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index cf75f89..deb1f82 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -820,10 +820,9 @@ static void igmp_timer_expire(struct timer_list *t) 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); -- 2.5.5