Re: VRF-like use of Network Namespaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers


[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux