diff options
author | Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 2010-10-25 10:43:32 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-09 15:55:39 -0700 |
commit | c33790ec1212ef7a3f302c3e410cba6e0affe489 (patch) | |
tree | 45692b9cb916d204aa6b7a121313f0a27229e205 /net | |
parent | ffa7db22639e3df2c335691b9b0abbcba7ae18ed (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>
Diffstat (limited to 'net')
-rw-r--r-- | net/phonet/pn_dev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 5a2275c4ee79..d94ca91334d3 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c @@ -225,6 +225,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) |