fix error handle in ip_mc_add_src()
Subsystems (3)
PATCH 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.
Signed-off-by Jun Zhao <[email protected]>
---
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]--;for (j=0 ; j<i; j++) (void )ip_mc_del1_src (pmc, sfmode, &psfsrc[j]); }else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE ] !=0 )) {
Quoted 6 lines · Jun Zhao
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.
Signed-off-by Jun Zhao <[email protected]>
Thanks !
Acked-by Eric Dumazet <[email protected]>