[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJJAcof9Tgnoudq+Wk+68UCsjGHX9cu=OnpKQdpWR5amijFAtw@mail.gmail.com>
Date: Thu, 28 Mar 2013 16:12:32 +0200
From: David Shwatrz <dshwatrz@...il.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: netdev@...r.kernel.org
Subject: Re: Deleting a network namespace
Hello,
Thanks a lot for the detailed explanation!
>As for the rest having software based network devices vanish >is by
>design and I can't think of a single reason why it would make >sense to
>do anything differently.
Agreed.
Best,
DS
On Thu, Mar 28, 2013 at 4:00 PM, Eric W. Biederman
<ebiederm@...ssion.com> wrote:
> David Shwatrz <dshwatrz@...il.com> writes:
>
>> Hello,
>> I checked and indeed physical hardware are moved to init_net.
>> I wonder how it is done, as in netns_delete() there is only
>> umount2() and unlink() syscalls (might these syscalls trigger this
>> movement to init_net)?
>
> The mount holds a refcount to the network namespace, the unmount drops
> that refcount.
>
>> I really could not figure how this is
>> implemented and where in code do we differentiate between physical and
>> non physical devices.
>
> When the refcount drops to zero put_net calls __put_net in
> net/core/net_namespace.c which wiggles around and arranges
> for cleanup_net to be called.
>
> As for what happens to the network devices look at default_device_exit
> and default_device_exit_batch in net/core/dev.c
>
> As for the rest having software based network devices vanish is by
> design and I can't think of a single reason why it would make sense to
> do anything differently. Depending on your configuration the initial
> network namespace really isn't where you would want network devices to
> be moved. Think about what happens when you run your use can in a lxc
> based container for example.
>
> Eric
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists