On Wed, Sep 24, 2014 at 9:27 AM, Nicolas DichtelI understand your point but there is several use of netns. Netns can be used
Now informations got with 'ip link' are wrong and incomplete:
- the link dev is now tunl0 instead of eth0, because we only got an
from the kernel without any netns informations.
This is not new, macvlan has the same problem. This is why I said
it is mostly a display problem, maybe just mark the ifindex as -1 or
something when it is not in this netns. At least I don't expect the inner
netns know anything outside, and I don't think I am the only one using
netns in this way.
Your assumption here is that all dameons were started before the tunnel was
- the encapsulation addresses are not part of this netns but the user
known that (still because netns info is missing). These IPv4 addresses
exist into this netns.
I don't remember your x-netns code, but we have two choices:
1) Lookup the route of the netns which it is in
If the address is not available in this netns, it will fail, this is expected
since tunnel device is not a pure L2 device. Or maybe just fail
early when we move it.
2) Lookup the route of the netns where it was created
Transparent for upper layer, but as you said, the outer address is not
available in this netns therefore hard to display. Just hiding this information
doesn't seem wrong to me.
A different netns only means a different network stack, not a different user ns
- it's not possible to create the same netdevice with these infos.
This is expected, because after all you are already in a different netns.