Commit 685f94e6 authored by Jun Zhao's avatar Jun Zhao Committed by David S. Miller

ipv4 : igmp : 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.
Acked-by: default avatarDavid L Stevens <dlstevens@us.ibm.com>
Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarJun Zhao <mypopydev@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4d0fe50c
......@@ -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)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment