|
@@ -2126,7 +2126,7 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
|
|
ASSERT_RTNL();
|
|
ASSERT_RTNL();
|
|
|
|
|
|
in_dev = ip_mc_find_dev(net, imr);
|
|
in_dev = ip_mc_find_dev(net, imr);
|
|
- if (!in_dev) {
|
|
|
|
|
|
+ if (!imr->imr_ifindex && !imr->imr_address.s_addr && !in_dev) {
|
|
ret = -ENODEV;
|
|
ret = -ENODEV;
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -2147,7 +2147,8 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
|
|
|
|
|
|
*imlp = iml->next_rcu;
|
|
*imlp = iml->next_rcu;
|
|
|
|
|
|
- ip_mc_dec_group(in_dev, group);
|
|
|
|
|
|
+ if (in_dev)
|
|
|
|
+ ip_mc_dec_group(in_dev, group);
|
|
|
|
|
|
/* decrease mem now to avoid the memleak warning */
|
|
/* decrease mem now to avoid the memleak warning */
|
|
atomic_sub(sizeof(*iml), &sk->sk_omem_alloc);
|
|
atomic_sub(sizeof(*iml), &sk->sk_omem_alloc);
|