Skip to contentSkip to conversation

fix error handle in ip_mc_add_src()

PATCH Superseded Jun Zhao 3 participants 5 messages Nov 21, 2011 – Nov 23, 2011

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jun Zhao

author
#0 lore raw

PATCH v2 1/1 fix error handle in ip_mc_add_src()

from: Jun Zhao <[email protected]>

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..b2ca095 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)) {
maintainer
#1 lore raw

From: Jun Zhao <[email protected]>
Date: Tue, 22 Nov 2011 00:05:16 +0800

Quoted 8 lines

from: Jun Zhao <[email protected]>

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

Please use an appropriate prefix in your subject line after the closing "]" bracket. For example, something like "ipv4: " for this specific patch is fine.

Your patch has also been corrupted by your email client, it turned tab characters into spaces amongst other things. Please correct this, email a test patch to yourself, and make absolutely sure you are able to successfully apply it before you retry submitting your fix here.

Thank you.

author
#2 lore raw
Quoted 16 lines · David Miller

From: Jun Zhao <[email protected]>
Date: Tue, 22 Nov 2011 00:05:16 +0800

Quoted 8 lines

from: Jun Zhao <[email protected]>

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

Please use an appropriate prefix in your subject line after the closing "]" bracket. For example, something like "ipv4: " for this specific patch is fine.

Quoted 6 lines

Your patch has also been corrupted by your email client, it turned tab characters into spaces amongst other things. Please correct this, email a test patch to yourself, and make absolutely sure you are able to successfully apply it before you retry submitting your fix here.

Thank you.

Ok, I will double-check this according to your comments, after that, re-submit the patch, Tks.

#3 lore raw
In reply to Jun Zhao

Jun Zhao said, at 2011/11/22 0:05:

Quoted 14 lines

from: Jun Zhao<[email protected]>

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 +0 -0
index c7472ef..b2ca095 100644

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

Quoted 6 lines
net/ipv4/igmp.c +2 -1
@@ -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]--;

Tab is changed to space by your email client.

maintainer
#4 lore raw

From: ShanWei <[email protected]>
Date: Wed, 23 Nov 2011 16:25:01 +0800

Quoted 1 line

Tab is changed to space by your email client.

He knows, that's why he posted v3 already.

:-)