Skip to content

Commit c60e06c

Browse files
committed
Merge branch 'igmp-fix-two-incorrect-unsolicit-report-count-issues'
Hangbin Liu says: ==================== igmp: fix two incorrect unsolicit report count issues Just like the subject, fix two minor igmp unsolicit report count issues. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 93bbadd + ff06525 commit c60e06c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

net/ipv4/igmp.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -820,10 +820,9 @@ static void igmp_timer_expire(struct timer_list *t)
820820
spin_lock(&im->lock);
821821
im->tm_running = 0;
822822

823-
if (im->unsolicit_count) {
824-
im->unsolicit_count--;
823+
if (im->unsolicit_count && --im->unsolicit_count)
825824
igmp_start_timer(im, unsolicited_report_interval(in_dev));
826-
}
825+
827826
im->reporter = 1;
828827
spin_unlock(&im->lock);
829828

@@ -1308,6 +1307,8 @@ static void igmp_group_added(struct ip_mc_list *im)
13081307

13091308
if (in_dev->dead)
13101309
return;
1310+
1311+
im->unsolicit_count = net->ipv4.sysctl_igmp_qrv;
13111312
if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) {
13121313
spin_lock_bh(&im->lock);
13131314
igmp_start_timer(im, IGMP_INITIAL_REPORT_DELAY);
@@ -1391,9 +1392,6 @@ static void __ip_mc_inc_group(struct in_device *in_dev, __be32 addr,
13911392
unsigned int mode)
13921393
{
13931394
struct ip_mc_list *im;
1394-
#ifdef CONFIG_IP_MULTICAST
1395-
struct net *net = dev_net(in_dev->dev);
1396-
#endif
13971395

13981396
ASSERT_RTNL();
13991397

@@ -1420,7 +1418,6 @@ static void __ip_mc_inc_group(struct in_device *in_dev, __be32 addr,
14201418
spin_lock_init(&im->lock);
14211419
#ifdef CONFIG_IP_MULTICAST
14221420
timer_setup(&im->timer, igmp_timer_expire, 0);
1423-
im->unsolicit_count = net->ipv4.sysctl_igmp_qrv;
14241421
#endif
14251422

14261423
im->next_rcu = in_dev->mc_list;

0 commit comments

Comments
 (0)