Thread (14 messages) flat view 14 messages, 5 authors, 2017-02-06

Re: [PATCH net-next 2/2] Add a eBPF helper function to retrieve socket uid

From: Lorenzo Colitti <hidden>
Date: 2017-02-06 03:25:56

On Fri, Feb 3, 2017 at 10:51 AM, Eric Dumazet [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help