diff options
author | Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 2008-12-04 00:42:56 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-04 00:42:56 +0100 |
commit | 52404881984e2d447f920a23e3bb63262dfc77f3 (patch) | |
tree | 531b4ac50fe372d26bf950c77d31f2ddcb40153c /net/phonet/pn_dev.c | |
parent | xfrm: Accept XFRM_STATE_AF_UNSPEC SAs on IPv4/IPv6 only hosts (diff) | |
download | linux-52404881984e2d447f920a23e3bb63262dfc77f3.tar.xz linux-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.c | 6 |
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) |