Thread (14 messages) flat view 14 messages, 7 authors, 2014-02-13

Re: [PATCH] net: clear iflink when moving to a new netns

From: Cong Wang <hidden>
Date: 2014-02-13 01:34:33

On Wed, Feb 12, 2014 at 3:18 PM, Ben Hutchings [off-list ref] wrote:
On Tue, 2014-02-11 at 15:51 -0800, Cong Wang wrote:
quoted
From: Cong Wang <redacted>

BZ: https://bugzilla.kernel.org/show_bug.cgi?id=66691

macvlan and vlan both use iflink to identify its lower device,
however, after such device is moved to the new netns, its iflink
would become meaningless as ifindex is per netns. So, instead of
forbid them moving to another netns, just clear this field so that
it will not be dumped at least.
[...]

And what if it's moved back into the same netns?
Good point!
I think iflink should be changed to a net_device pointer, so it remains
valid for in-kernel users but rtnetlink can do the netns check before
revealing it to userland.
I will try this approach.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help