On Fri, Feb 3, 2017 at 10:51 AM, Eric Dumazet <eric.duma...@gmail.com> wrote: > if (sk) { > sk = sk_to_full_sk(sk); > if (sk_fullsock(sk)) > return sk->sk_uid; > }
Sure, though sk_to_full_sk is in inet_sock.h so I have to move some core around. Options I see: 1. Move sk_to_full_sk from inet_sock.h to sock.h. 2. Move sock_net_uid to inet_sock.h. 3. Move sock_net_uid to sock.c and EXPORT_SYMBOL_GPL it. Thoughts? #1 seems reasonable, since sk_fullsock is already in sock.h. #2 would mean that we can't call sock_net_uid from non-inet code. Currently the only code that accesses sk->sk_uid is inet code, but in the future perhaps some of the code around the tree that calls sock_i_uid could be migrated to use at sk->sk_uid instead.