On Thu, Dec 7, 2017 at 9:28 PM, Tonghao Zhang <xiangxia.m....@gmail.com> wrote: > > Release the netlink sock created in kernel(not hold the _net_ namespace): >
You can avoid counting kernel sock by testing 'kern' in sk_alloc() and testing 'sk->sk_net_refcnt' in __sk_free().