All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues
@ 2018-08-29 10:06 Hangbin Liu
  2018-08-29 10:06 ` [PATCH net 1/2] igmp: fix incorrect unsolicit report count when join group Hangbin Liu
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Hangbin Liu @ 2018-08-29 10:06 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Hangbin Liu

Just like the subject, fix two minor igmp unsolicit report count issues.

Hangbin Liu (2):
  igmp: fix incorrect unsolicit report count when join group
  igmp: fix incorrect unsolicit report count after link down and up

 net/ipv4/igmp.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net 1/2] igmp: fix incorrect unsolicit report count when join group
  2018-08-29 10:06 [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues Hangbin Liu
@ 2018-08-29 10:06 ` Hangbin Liu
  2018-08-29 10:06 ` Hangbin Liu
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Hangbin Liu @ 2018-08-29 10:06 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Hangbin Liu

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>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 1/2] igmp: fix incorrect unsolicit report count when join group
  2018-08-29 10:06 [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues Hangbin Liu
  2018-08-29 10:06 ` [PATCH net 1/2] igmp: fix incorrect unsolicit report count when join group Hangbin Liu
@ 2018-08-29 10:06 ` Hangbin Liu
  2018-08-29 10:06 ` [PATCH net 2/2] igmp: fix incorrect unsolicit report count after link down and up Hangbin Liu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Hangbin Liu @ 2018-08-29 10:06 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Hangbin Liu

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>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 2/2] igmp: fix incorrect unsolicit report count after link down and up
  2018-08-29 10:06 [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues Hangbin Liu
  2018-08-29 10:06 ` [PATCH net 1/2] igmp: fix incorrect unsolicit report count when join group Hangbin Liu
  2018-08-29 10:06 ` Hangbin Liu
@ 2018-08-29 10:06 ` Hangbin Liu
  2018-08-29 10:06 ` Hangbin Liu
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Hangbin Liu @ 2018-08-29 10:06 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Hangbin Liu

After link down and up, i.e. when call ip_mc_up(), we doesn't init
im->unsolicit_count. So after igmp_timer_expire(), we will not start
timer again and only send one unsolicit report at last.

Fix it by initializing im->unsolicit_count in igmp_group_added(), so
we can respect igmp robustness value.

Fixes: 24803f38a5c0b ("igmp: do not remove igmp souce list info when set link down")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/ipv4/igmp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index deb1f82..4da3944 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1307,6 +1307,8 @@ static void igmp_group_added(struct ip_mc_list *im)
 
 	if (in_dev->dead)
 		return;
+
+	im->unsolicit_count = net->ipv4.sysctl_igmp_qrv;
 	if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) {
 		spin_lock_bh(&im->lock);
 		igmp_start_timer(im, IGMP_INITIAL_REPORT_DELAY);
@@ -1390,9 +1392,6 @@ static void __ip_mc_inc_group(struct in_device *in_dev, __be32 addr,
 			      unsigned int mode)
 {
 	struct ip_mc_list *im;
-#ifdef CONFIG_IP_MULTICAST
-	struct net *net = dev_net(in_dev->dev);
-#endif
 
 	ASSERT_RTNL();
 
@@ -1419,7 +1418,6 @@ static void __ip_mc_inc_group(struct in_device *in_dev, __be32 addr,
 	spin_lock_init(&im->lock);
 #ifdef CONFIG_IP_MULTICAST
 	timer_setup(&im->timer, igmp_timer_expire, 0);
-	im->unsolicit_count = net->ipv4.sysctl_igmp_qrv;
 #endif
 
 	im->next_rcu = in_dev->mc_list;
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 2/2] igmp: fix incorrect unsolicit report count after link down and up
  2018-08-29 10:06 [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues Hangbin Liu
                   ` (2 preceding siblings ...)
  2018-08-29 10:06 ` [PATCH net 2/2] igmp: fix incorrect unsolicit report count after link down and up Hangbin Liu
@ 2018-08-29 10:06 ` Hangbin Liu
  2018-08-29 11:08 ` [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues Hangbin Liu
  2018-09-02 20:39 ` David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: Hangbin Liu @ 2018-08-29 10:06 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Hangbin Liu

After link down and up, i.e. when call ip_mc_up(), we doesn't init
im->unsolicit_count. So after igmp_timer_expire(), we will not start
timer again and only send one unsolicit report at last.

Fix it by initializing im->unsolicit_count in igmp_group_added(), so
we can respect igmp robustness value.

Fixes: 24803f38a5c0b ("igmp: do not remove igmp souce list info when set link down")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/ipv4/igmp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index deb1f82..4da3944 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1307,6 +1307,8 @@ static void igmp_group_added(struct ip_mc_list *im)
 
 	if (in_dev->dead)
 		return;
+
+	im->unsolicit_count = net->ipv4.sysctl_igmp_qrv;
 	if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) {
 		spin_lock_bh(&im->lock);
 		igmp_start_timer(im, IGMP_INITIAL_REPORT_DELAY);
@@ -1390,9 +1392,6 @@ static void __ip_mc_inc_group(struct in_device *in_dev, __be32 addr,
 			      unsigned int mode)
 {
 	struct ip_mc_list *im;
-#ifdef CONFIG_IP_MULTICAST
-	struct net *net = dev_net(in_dev->dev);
-#endif
 
 	ASSERT_RTNL();
 
@@ -1419,7 +1418,6 @@ static void __ip_mc_inc_group(struct in_device *in_dev, __be32 addr,
 	spin_lock_init(&im->lock);
 #ifdef CONFIG_IP_MULTICAST
 	timer_setup(&im->timer, igmp_timer_expire, 0);
-	im->unsolicit_count = net->ipv4.sysctl_igmp_qrv;
 #endif
 
 	im->next_rcu = in_dev->mc_list;
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues
  2018-08-29 10:06 [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues Hangbin Liu
                   ` (3 preceding siblings ...)
  2018-08-29 10:06 ` Hangbin Liu
@ 2018-08-29 11:08 ` Hangbin Liu
  2018-09-02 20:39 ` David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: Hangbin Liu @ 2018-08-29 11:08 UTC (permalink / raw)
  To: netdev; +Cc: David Miller

Opps, sent two duplicate mails by mistake.
Please ignore the duplicate messages. Sorry.

On Wed, Aug 29, 2018 at 06:06:07PM +0800, Hangbin Liu wrote:
> Just like the subject, fix two minor igmp unsolicit report count issues.
> 
> Hangbin Liu (2):
>   igmp: fix incorrect unsolicit report count when join group
>   igmp: fix incorrect unsolicit report count after link down and up
> 
>  net/ipv4/igmp.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> -- 
> 2.5.5
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues
  2018-08-29 10:06 [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues Hangbin Liu
                   ` (4 preceding siblings ...)
  2018-08-29 11:08 ` [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues Hangbin Liu
@ 2018-09-02 20:39 ` David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2018-09-02 20:39 UTC (permalink / raw)
  To: liuhangbin; +Cc: netdev

From: Hangbin Liu <liuhangbin@gmail.com>
Date: Wed, 29 Aug 2018 18:06:07 +0800

> Just like the subject, fix two minor igmp unsolicit report count issues.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-09-03  0:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-29 10:06 [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues Hangbin Liu
2018-08-29 10:06 ` [PATCH net 1/2] igmp: fix incorrect unsolicit report count when join group Hangbin Liu
2018-08-29 10:06 ` Hangbin Liu
2018-08-29 10:06 ` [PATCH net 2/2] igmp: fix incorrect unsolicit report count after link down and up Hangbin Liu
2018-08-29 10:06 ` Hangbin Liu
2018-08-29 11:08 ` [PATCH net 0/2] igmp: fix two incorrect unsolicit report count issues Hangbin Liu
2018-09-02 20:39 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.