[Devel] Re: VRF-like use of Network Namespaces
Dan Smith
danms at us.ibm.com
Fri Jun 11 07:59:17 PDT 2010
MP> I saw there was a rtnetlink attribute to set the netns of a device but it
MP> uses the PID of a namespace owner to do so... within 'ip' i can refer to
MP> only one namespace (i.e. the one that 'ip' task_struct->ns_proxy currently
MP> points to), so I won't be able to move an interface from outside my
MP> namespace to my namespace...
Not just the owner, but any process in the namespace, AFAIK. So, you
should be able to fork() a child, have that child setns() into the
namespace of your choosing, and then move the device to the process of
your child (since you now know the pid). It's a little indirect, but
it should work.
--
Dan Smith
IBM Linux Technology Center
email: danms at us.ibm.com
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list