All of lore.kernel.org
 help / color / mirror / Atom feed
* Retrieving the network namespace of a socket
@ 2021-10-20  9:57 Sargun Dhillon
  2021-10-20 14:03 ` Sergey Ryazanov
  0 siblings, 1 reply; 6+ messages in thread
From: Sargun Dhillon @ 2021-10-20  9:57 UTC (permalink / raw)
  To: LKML, netdev, Christian Brauner

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-21  9:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20  9:57 Retrieving the network namespace of a socket Sargun Dhillon
2021-10-20 14:03 ` Sergey Ryazanov
2021-10-20 16:34   ` Sargun Dhillon
2021-10-20 19:24     ` Sargun Dhillon
2021-10-21  9:20       ` Christian Brauner
2021-10-20 20:02     ` Sergey Ryazanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.