aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDaniel Lezcano <dlezcano@fr.ibm.com>2008-11-25 19:46:37 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-25 19:46:37 -0500
commit09bb52175bf4d6a46fc8502e76be29206d9a677a (patch)
tree93053a60197f03f66a7089fbf88f64ee93a955b8 /net/core
parentcb13fc209f5c9394713319323166f74b01759ead (diff)
netns: filter out uevent not belonging to init_net
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. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/net-sysfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index afd42d717320..6ac29a46e23e 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -427,6 +427,9 @@ static int netdev_uevent(struct device *d, struct kobj_uevent_env *env)
427 struct net_device *dev = to_net_dev(d); 427 struct net_device *dev = to_net_dev(d);
428 int retval; 428 int retval;
429 429
430 if (!net_eq(dev_net(dev), &init_net))
431 return 0;
432
430 /* pass interface to uevent. */ 433 /* pass interface to uevent. */
431 retval = add_uevent_var(env, "INTERFACE=%s", dev->name); 434 retval = add_uevent_var(env, "INTERFACE=%s", dev->name);
432 if (retval) 435 if (retval)