From: ebiederm@xmission.com (Eric W. Biederman)
To: Daniel Lezcano <dlezcano@fr.ibm.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
benjamin.thery@bull.net, containers@lists.osdl.org
Subject: Re: [patch 1/1] netns: filter out uevent not belonging to init_net
Date: Tue, 25 Nov 2008 09:40:59 -0800 [thread overview]
Message-ID: <m14p1vg0us.fsf@frodo.ebiederm.org> (raw)
In-Reply-To: <20081125165346.554858327@mai-009101017029.toulouse-stg.fr.ibm.com> (Daniel Lezcano's message of "Tue, 25 Nov 2008 17:52:00 +0100")
Daniel Lezcano <dlezcano@fr.ibm.com> writes:
> This patch will filter out the uevent not related to the init_net.
> Without this patch if a network device is created in a network
> namespace with the same name as one network device belonging to the
> initial network namespace (eg. eth0), when the network namespace
> will die and the network device will be destroyed, an event will
> be sent and catched by the udevd daemon. That will result to have
> the real network device to be shutdown because the udevd/uevent are
> not namespace aware.
It is belt and suspenders at this point. As those devices should
not even be in sysfs at the moment. But it keeps us from doing the
wrong thing when sysfs support starts coming on line.
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
> ---
> net/core/net-sysfs.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> Index: net-next-2.6/net/core/net-sysfs.c
> ===================================================================
> --- net-next-2.6.orig/net/core/net-sysfs.c
> +++ net-next-2.6/net/core/net-sysfs.c
> @@ -427,6 +427,9 @@ static int netdev_uevent(struct device *
> struct net_device *dev = to_net_dev(d);
> int retval;
>
> + if (!net_eq(dev_net(dev), &init_net))
> + return 0;
> +
> /* pass interface to uevent. */
> retval = add_uevent_var(env, "INTERFACE=%s", dev->name);
> if (retval)
next parent reply other threads:[~2008-11-25 17:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20081125165159.411202515@mai-009101017029.toulouse-stg.fr.ibm.com>
[not found] ` <20081125165346.554858327@mai-009101017029.toulouse-stg.fr.ibm.com>
2008-11-25 17:40 ` Eric W. Biederman [this message]
2008-11-26 0:46 ` [patch 1/1] netns: filter out uevent not belonging to init_net David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m14p1vg0us.fsf@frodo.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=benjamin.thery@bull.net \
--cc=containers@lists.osdl.org \
--cc=davem@davemloft.net \
--cc=dlezcano@fr.ibm.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).