I need some good examples on how to obtain the NAME of a net namespace from inside the kernel. Getting device names is straightforward but it's not so obvious for net namespaces. Does anyone know a simple method to get the net namespace name from inside the kernel.
The following code does print out all devices in all net namespaces, how do I get the name of the namespace to print from inside the kernel. The struct net structure does not point to the name as near as I can tell.
for_each_net(net) for_each_netdev(net, dev) printk("dev_name: %s netns: %p\n", dev->name, net);