aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>2010-10-25 10:43:32 +0300
committerAndi Kleen <ak@linux.intel.com>2011-08-01 13:54:47 -0700
commitd58f50ab3cb89696982deeae32ef9e0eab96f787 (patch)
treede93397263dc1c0c6c8ce7e5254009cd2c7d88b9 /net
parent6f40d761f0210858e4adbadd33b55020d291ef76 (diff)
Phonet: device notifier only runs on initial namespace
[bwh: This is only applicable to 2.6.32. Phonet was fixed upstream to work with multiple net namespaces.] This should really fix the OOPS when doing: unshare(CLONE_NEWNET); exit(0); while the phonet module is loaded. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/phonet/pn_dev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index c33da657694..29ae2bd677c 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -298,6 +298,9 @@ static int phonet_device_notify(struct notifier_block *me, unsigned long what,
{
struct net_device *dev = arg;
+ if (!net_eq(dev_net(dev), &init_net))
+ return 0;
+
switch (what) {
case NETDEV_REGISTER:
if (dev->type == ARPHRD_PHONET)