netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Identifying a network namespace
@ 2018-12-14 11:19 Jean Delvare
  2018-12-14 17:30 ` Nicolas Dichtel
  0 siblings, 1 reply; 2+ messages in thread
From: Jean Delvare @ 2018-12-14 11:19 UTC (permalink / raw)
  To: netdev

Hi all,

The question: is there any way to uniquely identify a network namespace
in the kernel?

The context: for debugging purposes, I need to log information about
network devices. netdev_info() uses the device name to identify the
device, however there can be several devices by that name in different
namespaces. To know which device the message relates to, I would need
to know the namespace in addition to the device name. For all I know,
the namespace's name is a user-space thing and the kernel has no idea.
But I would at least need some kind of unique identifier to group log
message by device.

So far I'm using the struct address returned by dev_net() as the unique
ID, but leaking kernel addresses to userspace is not recommended. So I
am wondering, is there another recommended way to uniquely identify a
network namespace in a log message?

Thanks,
-- 
Jean Delvare
SUSE L3 Support

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

end of thread, other threads:[~2018-12-14 17:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-14 11:19 Identifying a network namespace Jean Delvare
2018-12-14 17:30 ` Nicolas Dichtel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).