Protocol control sockets and netlink kernel sockets should not prevent the
namespace stop request. They are initialized and disposed in a special way by
sk_change_net/sk_release_kernel.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
static inline void sk_change_net(struct sock *sk, struct net *net)
{
put_net(sock_net(sk));
- sock_net_set(sk, net);
+ sock_net_set(sk, hold_net(net));
}
extern void sock_enable_timestamp(struct sock *sk);
sock_hold(sk);
sock_release(sk->sk_socket);
+ release_net(sock_net(sk));
sock_net_set(sk, get_net(&init_net));
sock_put(sk);
}