diff options
author | remi.denis-courmont@nokia <remi.denis-courmont@nokia> | 2009-01-23 03:00:30 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-26 21:03:35 -0800 |
commit | 9a3b7a42bb2919a6282a96a5f4abe0f9be36c4b3 (patch) | |
tree | db61d026f3cbd58b767b01e3b5499f5a2e75464a /net/phonet/pn_netlink.c | |
parent | 6530e0fee1834fab51720769ac422186de2b3120 (diff) |
Phonet: use per-namespace devices list
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_netlink.c')
-rw-r--r-- | net/phonet/pn_netlink.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c index 918a4f07f24..1ceea1f9241 100644 --- a/net/phonet/pn_netlink.c +++ b/net/phonet/pn_netlink.c @@ -123,17 +123,16 @@ nla_put_failure: static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb) { - struct net *net = sock_net(skb->sk); + struct phonet_device_list *pndevs; struct phonet_device *pnd; int dev_idx = 0, dev_start_idx = cb->args[0]; int addr_idx = 0, addr_start_idx = cb->args[1]; - spin_lock_bh(&pndevs.lock); - list_for_each_entry(pnd, &pndevs.list, list) { + pndevs = phonet_device_list(sock_net(skb->sk)); + spin_lock_bh(&pndevs->lock); + list_for_each_entry(pnd, &pndevs->list, list) { u8 addr; - if (!net_eq(dev_net(pnd->netdev), net)) - continue; if (dev_idx > dev_start_idx) addr_start_idx = 0; if (dev_idx++ < dev_start_idx) @@ -153,7 +152,7 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb) } out: - spin_unlock_bh(&pndevs.lock); + spin_unlock_bh(&pndevs->lock); cb->args[0] = dev_idx; cb->args[1] = addr_idx; |