lkml.org 
[lkml]   [2021]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRetrieving the network namespace of a socket
I'm working on a problem where I need to determine which network namespace a 
given socket is in. I can currently bruteforce this by using INET_DIAG, and
enumerating namespaces and working backwards.

I was wondering if anyone had any suggestions on where to add this capability,
or suggestions how on how it might look? It appears like using network namespace
IDs is the thing to do -- I'm unsure of whether this API fits better into
ioctl_ns, getsockopt, netlink, or even somewhere in proc. I'm curious what
people think. I think that the "easiest" way would be to drop it into fdinfo
in proc.

Alternatively, I may have overlooked an existing API.

-Thanks,
Sargun

\
 
 \ /
  Last update: 2021-10-20 11:57    [W:0.063 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site