diff options
author | Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 2008-12-03 18:42:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-03 18:42:56 -0500 |
commit | 52404881984e2d447f920a23e3bb63262dfc77f3 (patch) | |
tree | 531b4ac50fe372d26bf950c77d31f2ddcb40153c /net/phonet/pn_dev.c | |
parent | d81d228567f55af517796638075dbbce9b40d7af (diff) |
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) | |||
76 | dev = pnd->netdev; | 76 | dev = pnd->netdev; |
77 | BUG_ON(!dev); | 77 | BUG_ON(!dev); |
78 | 78 | ||
79 | if (dev_net(dev) == net && | 79 | if (net_eq(dev_net(dev), net) && |
80 | (dev->reg_state == NETREG_REGISTERED) && | 80 | (dev->reg_state == NETREG_REGISTERED) && |
81 | ((pnd->netdev->flags & IFF_UP)) == IFF_UP) | 81 | ((pnd->netdev->flags & IFF_UP)) == IFF_UP) |
82 | break; | 82 | break; |
@@ -140,12 +140,14 @@ u8 phonet_address_get(struct net_device *dev, u8 addr) | |||
140 | return addr; | 140 | return addr; |
141 | } | 141 | } |
142 | 142 | ||
143 | int phonet_address_lookup(u8 addr) | 143 | int phonet_address_lookup(struct net *net, u8 addr) |
144 | { | 144 | { |
145 | struct phonet_device *pnd; | 145 | struct phonet_device *pnd; |
146 | 146 | ||
147 | spin_lock_bh(&pndevs.lock); | 147 | spin_lock_bh(&pndevs.lock); |
148 | list_for_each_entry(pnd, &pndevs.list, list) { | 148 | list_for_each_entry(pnd, &pndevs.list, list) { |
149 | if (!net_eq(dev_net(pnd->netdev), net)) | ||
150 | continue; | ||
149 | /* Don't allow unregistering devices! */ | 151 | /* Don't allow unregistering devices! */ |
150 | if ((pnd->netdev->reg_state != NETREG_REGISTERED) || | 152 | if ((pnd->netdev->reg_state != NETREG_REGISTERED) || |
151 | ((pnd->netdev->flags & IFF_UP)) != IFF_UP) | 153 | ((pnd->netdev->flags & IFF_UP)) != IFF_UP) |