{
int i;
- for_each_possible_cpu(i) {
- struct sock *sk;
-
- sk = __icmp_sk[i];
- if (sk == NULL)
- continue;
- sock_release(sk->sk_socket);
- }
+ for_each_possible_cpu(i)
+ sk_release_kernel(__icmp_sk[i]);
kfree(__icmp_sk);
__icmp_sk = NULL;
}
goto fail;
__icmp_sk[i] = sk = sock->sk;
+ sk_change_net(sk, &init_net);
+
sk->sk_allocation = GFP_ATOMIC;
/* Enough space for 2 64K ICMP packets, including
}
__icmpv6_sk[i] = sk = sock->sk;
+ sk_change_net(sk, &init_net);
+
sk->sk_allocation = GFP_ATOMIC;
/*
* Split off their lock-class, because sk->sk_dst_lock
return 0;
fail:
- for (j = 0; j < i; j++) {
- if (!cpu_possible(j))
- continue;
- sock_release(__icmpv6_sk[j]->sk_socket);
- }
+ for (j = 0; j < i; j++)
+ sk_release_kernel(__icmpv6_sk[j]);
return err;
}
int i;
for_each_possible_cpu(i) {
- sock_release(__icmpv6_sk[i]->sk_socket);
+ sk_release_kernel(__icmpv6_sk[i]);
}
inet6_del_protocol(&icmpv6_protocol, IPPROTO_ICMPV6);
}