diff options
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) |