On 04/13/2012 12:37 AM, Serge Hallyn wrote: > The simple solution would be to use lxc-attach to call ifconfig in the > container. lxc-attach does not work yet because some namespaces do not > support it. However, /proc/self/ns/net exists. It can be used to > switch to the container's network namespace, and then use > ioctl(SIOCGIFADDR) on the result of socket(PF_INET, SOCK_DGRAM, IPPROTO_IP).
Hi Serge, thank you for your reply, your suggested solution (using setns to switch the namespace) is really interesting. How do you want to proceed? We can use the program you wrote or maybe we can follow the same path using, e.g., Python/ctypes or Go? Should we instead consider waiting for lxc-attach to be ready? -- Francesco Banconi -- Mailing list: https://launchpad.net/~yellow Post to : [email protected] Unsubscribe : https://launchpad.net/~yellow More help : https://help.launchpad.net/ListHelp

