public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] fix error handle in ip_mc_add_src()
@ 2011-11-21 15:05 Jun Zhao
  2011-11-21 15:24 ` Eric Dumazet
  2011-11-21 18:30 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Jun Zhao @ 2011-11-21 15:05 UTC (permalink / raw)
  To: davem; +Cc: netdev

When add sources to interface failure, need to roll back the sfcount[MODE] 
to before state. We need to match it corresponding. 

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index c7472ef..276719a 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1716,7 +1716,8 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
 	if (err) {
 		int j;
 
-		pmc->sfcount[sfmode]--;
+		if(!delta)
+			pmc->sfcount[sfmode]--;
 		for (j=0; j<i; j++)
 			(void) ip_mc_del1_src(pmc, sfmode, &psfsrc[j]);
 	} else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE] != 0)) {

Signed-off-by: Jun Zhao <mypopydev@gmail.com>

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

* Re: [patch] fix error handle in ip_mc_add_src()
  2011-11-21 15:05 [patch] fix error handle in ip_mc_add_src() Jun Zhao
@ 2011-11-21 15:24 ` Eric Dumazet
  2011-11-21 15:30   ` Jun Zhao
  2011-11-21 18:30 ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Dumazet @ 2011-11-21 15:24 UTC (permalink / raw)
  To: Jun Zhao; +Cc: davem, netdev

Le lundi 21 novembre 2011 à 23:05 +0800, Jun Zhao a écrit :
> When add sources to interface failure, need to roll back the sfcount[MODE] 
> to before state. We need to match it corresponding. 
> 

Missing "---" separator

> diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
> index c7472ef..276719a 100644
> --- a/net/ipv4/igmp.c
> +++ b/net/ipv4/igmp.c
> @@ -1716,7 +1716,8 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
>  	if (err) {
>  		int j;
>  
> -		pmc->sfcount[sfmode]--;
> +		if(!delta)

Missing space, should be  : if (!delta)

> +			pmc->sfcount[sfmode]--;
>  		for (j=0; j<i; j++)
>  			(void) ip_mc_del1_src(pmc, sfmode, &psfsrc[j]);
>  	} else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE] != 0)) {
> 
> Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> 

Your "Signed-off-by:" should come before actual patch

Please read Documentation/SubmittingPatches

Thanks

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

* Re: [patch] fix error handle in ip_mc_add_src()
  2011-11-21 15:24 ` Eric Dumazet
@ 2011-11-21 15:30   ` Jun Zhao
  2011-11-21 15:37     ` David Stevens
  0 siblings, 1 reply; 7+ messages in thread
From: Jun Zhao @ 2011-11-21 15:30 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: davem, netdev

On Mon, 2011-11-21 at 16:24 +0100, Eric Dumazet wrote:
> Le lundi 21 novembre 2011 à 23:05 +0800, Jun Zhao a écrit :
> > When add sources to interface failure, need to roll back the sfcount[MODE] 
> > to before state. We need to match it corresponding. 
> > 
> 
> Missing "---" separator
> 
> > diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
> > index c7472ef..276719a 100644
> > --- a/net/ipv4/igmp.c
> > +++ b/net/ipv4/igmp.c
> > @@ -1716,7 +1716,8 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
> >  	if (err) {
> >  		int j;
> >  
> > -		pmc->sfcount[sfmode]--;
> > +		if(!delta)
> 
> Missing space, should be  : if (!delta)
> 
> > +			pmc->sfcount[sfmode]--;
> >  		for (j=0; j<i; j++)
> >  			(void) ip_mc_del1_src(pmc, sfmode, &psfsrc[j]);
> >  	} else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE] != 0)) {
> > 
> > Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> > 
> 
> Your "Signed-off-by:" should come before actual patch
> 
> Please read Documentation/SubmittingPatches
> 
> Thanks
> 
> 
> 

Tks, Eric Dumazet , I will re-submit this patch and follow the format.

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

* Re: [patch] fix error handle in ip_mc_add_src()
  2011-11-21 15:30   ` Jun Zhao
@ 2011-11-21 15:37     ` David Stevens
  0 siblings, 0 replies; 7+ messages in thread
From: David Stevens @ 2011-11-21 15:37 UTC (permalink / raw)
  To: Jun Zhao; +Cc: davem, Eric Dumazet, netdev, netdev-owner


With Eric's changes,

Acked-by: David L Stevens <dlstevens@us.ibm.com>

Good catch!

					+-DLS

netdev-owner@vger.kernel.org wrote on 11/21/2011 07:30:10 AM:

> From: Jun Zhao <mypopydev@gmail.com>
> To: Eric Dumazet <eric.dumazet@gmail.com>,
> Cc: davem@davemloft.net, netdev@vger.kernel.org
> Date: 11/21/2011 07:32 AM
> Subject: Re: [patch] fix error handle in ip_mc_add_src()
> Sent by: netdev-owner@vger.kernel.org
>
> On Mon, 2011-11-21 at 16:24 +0100, Eric Dumazet wrote:
> > Le lundi 21 novembre 2011 à 23:05 +0800, Jun Zhao a écrit :
> > > When add sources to interface failure, need to roll back the
> sfcount[MODE]
> > > to before state. We need to match it corresponding.
> > >
> >
> > Missing "---" separator
> >
> > > diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
> > > index c7472ef..276719a 100644
> > > --- a/net/ipv4/igmp.c
> > > +++ b/net/ipv4/igmp.c
> > > @@ -1716,7 +1716,8 @@ static int ip_mc_add_src(struct in_device
> *in_dev, __be32 *pmca, int sfmode,
> > >     if (err) {
> > >        int j;
> > >
> > > -      pmc->sfcount[sfmode]--;
> > > +      if(!delta)
> >
> > Missing space, should be  : if (!delta)
> >
> > > +         pmc->sfcount[sfmode]--;
> > >        for (j=0; j<i; j++)
> > >           (void) ip_mc_del1_src(pmc, sfmode, &psfsrc[j]);
> > >     } else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE] != 0)) {
> > >
> > > Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> > >
> >
> > Your "Signed-off-by:" should come before actual patch
> >
> > Please read Documentation/SubmittingPatches
> >
> > Thanks
> >
> >
> >
>
> Tks, Eric Dumazet , I will re-submit this patch and follow the format.
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* [patch] fix error handle in ip_mc_add_src()
@ 2011-11-21 15:51 Jun Zhao
  2011-11-21 16:00 ` Eric Dumazet
  0 siblings, 1 reply; 7+ messages in thread
From: Jun Zhao @ 2011-11-21 15:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, Eric Dumazet, David Stevens

from: Jun Zhao <mypopydev@gmail.com>

When add sources to interface failure, need to roll back the sfcount[MODE] 
to before state. We need to match it corresponding. 

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index c7472ef..b2ca095 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1716,7 +1716,8 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
 	if (err) {
 		int j;
 
-		pmc->sfcount[sfmode]--;
+		if (!delta)
+			pmc->sfcount[sfmode]--;
 		for (j=0; j<i; j++)
 			(void) ip_mc_del1_src(pmc, sfmode, &psfsrc[j]);
 	} else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE] != 0)) {

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

* Re: [patch] fix error handle in ip_mc_add_src()
  2011-11-21 15:51 Jun Zhao
@ 2011-11-21 16:00 ` Eric Dumazet
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Dumazet @ 2011-11-21 16:00 UTC (permalink / raw)
  To: Jun Zhao; +Cc: davem, netdev, David Stevens

Le lundi 21 novembre 2011 à 23:51 +0800, Jun Zhao a écrit :
> from: Jun Zhao <mypopydev@gmail.com>
> 
> When add sources to interface failure, need to roll back the sfcount[MODE] 
> to before state. We need to match it corresponding. 
> 
> Signed-off-by: Jun Zhao <mypopydev@gmail.com>

Thanks !

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

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

* Re: [patch] fix error handle in ip_mc_add_src()
  2011-11-21 15:05 [patch] fix error handle in ip_mc_add_src() Jun Zhao
  2011-11-21 15:24 ` Eric Dumazet
@ 2011-11-21 18:30 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2011-11-21 18:30 UTC (permalink / raw)
  To: mypopydev; +Cc: netdev

From: Jun Zhao <mypopydev@gmail.com>
Date: Mon, 21 Nov 2011 23:05:46 +0800

> When add sources to interface failure, need to roll back the sfcount[MODE] 
> to before state. We need to match it corresponding. 

You need to private a proper "Signed-off-by: " tag with your patch, please
read Documentation/SubmittingPatches.

DO not just reply to this email with the signoff tag, instead make a new,
fresh, clean posting of your patch with the necessary tag.

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

end of thread, other threads:[~2011-11-21 18:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-21 15:05 [patch] fix error handle in ip_mc_add_src() Jun Zhao
2011-11-21 15:24 ` Eric Dumazet
2011-11-21 15:30   ` Jun Zhao
2011-11-21 15:37     ` David Stevens
2011-11-21 18:30 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2011-11-21 15:51 Jun Zhao
2011-11-21 16:00 ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox