summaryrefslogtreecommitdiff
path: root/net/phonet/pn_dev.c
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>2008-12-03 15:42:56 -0800
committerDavid S. Miller <davem@davemloft.net>2008-12-03 15:42:56 -0800
commit52404881984e2d447f920a23e3bb63262dfc77f3 (patch)
tree531b4ac50fe372d26bf950c77d31f2ddcb40153c /net/phonet/pn_dev.c
parentd81d228567f55af517796638075dbbce9b40d7af (diff)
downloadlwn-52404881984e2d447f920a23e3bb63262dfc77f3.tar.gz
lwn-52404881984e2d447f920a23e3bb63262dfc77f3.zip
Phonet: basic net namespace support
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/phonet/pn_dev.c')
-rw-r--r--net/phonet/pn_dev.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index f93ff8ef47d0..5491bf5e354b 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -76,7 +76,7 @@ struct net_device *phonet_device_get(struct net *net)
dev = pnd->netdev;
BUG_ON(!dev);
- if (dev_net(dev) == net &&
+ if (net_eq(dev_net(dev), net) &&
(dev->reg_state == NETREG_REGISTERED) &&
((pnd->netdev->flags & IFF_UP)) == IFF_UP)
break;
@@ -140,12 +140,14 @@ u8 phonet_address_get(struct net_device *dev, u8 addr)
return addr;
}
-int phonet_address_lookup(u8 addr)
+int phonet_address_lookup(struct net *net, u8 addr)
{
struct phonet_device *pnd;
spin_lock_bh(&pndevs.lock);
list_for_each_entry(pnd, &pndevs.list, list) {
+ if (!net_eq(dev_net(pnd->netdev), net))
+ continue;
/* Don't allow unregistering devices! */
if ((pnd->netdev->reg_state != NETREG_REGISTERED) ||
((pnd->netdev->flags & IFF_UP)) != IFF_UP)