Skip to contentSkip to conversation

fix error handle in ip_mc_add_src()

PATCH In review Jun Zhao 4 participants 5 messages Nov 21, 2011

Subsystems (3)
lore
Share & tools
lore

Jun Zhao

author
#0 lore raw

PATCH 1/1 fix error handle in ip_mc_add_src()

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

net/ipv4/igmp.c +2 -1
index c7472ef..276719a 100644
@@ -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)) {
#1 lore raw
Quoted 3 lines · Jun Zhao

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

Missing "---" separator

net/ipv4/igmp.c static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, · line 1719

Quoted 10 lines
net/ipv4/igmp.c +1 -1
index c7472ef..276719a 100644
@@ -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)

Quoted 7 lines
net/ipv4/igmp.c +1 -0
+			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)) {

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

Please read Documentation/SubmittingPatches

Thanks

author
#2 lore raw
Quoted 25 lines · Eric Dumazet
Quoted 3 lines · Jun Zhao

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

Missing "---" separator

net/ipv4/igmp.c static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, · line 1719

Quoted 10 lines
net/ipv4/igmp.c +1 -1
index c7472ef..276719a 100644
@@ -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)

Quoted 5 lines
net/ipv4/igmp.c +1 -0
+			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)) {
Quoted 11 lines
Quoted 2 lines

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.

Acked-by
#3 lore raw

With Eric's changes,

Good catch!

					+-DLS

[email protected] wrote on 11/21/2011 07:30:10 AM:

Quoted 54 lines

From: Jun Zhao <[email protected]>
To: Eric Dumazet <[email protected]>,
Cc: [email protected], [email protected]
Date: 11/21/2011 07:32 AM
Subject: Re: [patch] fix error handle in ip_mc_add_src() Sent by: [email protected]

Quoted 2 lines · Eric Dumazet
Quoted 1 line · Jun Zhao

When add sources to interface failure, need to roll back the

sfcount[MODE]

Quoted 10 lines
Quoted 2 lines

to before state. We need to match it corresponding.

Missing "---" separator

net/ipv4/igmp.c static int ip_mc_add_src(struct in_device

Quoted 5 lines
net/ipv4/igmp.c +0 -0
index c7472ef..276719a 100644
@@ -1716,7 +1716,8 @@ static int ip_mc_add_src(struct in_device

*in_dev, __be32 *pmca, int sfmode,

Quoted 13 lines

net/ipv4/igmp.c static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, · line 1719

Quoted 5 lines
net/ipv4/igmp.c +1 -1
    if (err) {
       int j;
 
-      pmc->sfcount[sfmode]--;
+      if(!delta)

Missing space, should be : if (!delta)

Quoted 5 lines
net/ipv4/igmp.c +1 -0
+         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)) {
Quoted 11 lines
Quoted 2 lines

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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#4 lore raw
In reply to Jun Zhao

From: Jun Zhao <[email protected]>
Date: Mon, 21 Nov 2011 23:05:46 +0800

Quoted 2 lines

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.