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
Reply to
Eric Dumazet, 2017-02-03
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.
Thread (14 messages) 14 messages, 5 authors, last reply 2017-02-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help