Commit bd7df219 authored by remi.denis-courmont@nokia's avatar remi.denis-courmont@nokia Committed by David S. Miller

Phonet: do not dump addresses from other namespaces

Signed-off-by: default avatarRémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d25830e5
...@@ -123,6 +123,7 @@ nla_put_failure: ...@@ -123,6 +123,7 @@ nla_put_failure:
static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb) static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
{ {
struct net *net = sock_net(skb->sk);
struct phonet_device *pnd; struct phonet_device *pnd;
int dev_idx = 0, dev_start_idx = cb->args[0]; int dev_idx = 0, dev_start_idx = cb->args[0];
int addr_idx = 0, addr_start_idx = cb->args[1]; int addr_idx = 0, addr_start_idx = cb->args[1];
...@@ -131,6 +132,8 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -131,6 +132,8 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
list_for_each_entry(pnd, &pndevs.list, list) { list_for_each_entry(pnd, &pndevs.list, list) {
u8 addr; u8 addr;
if (!net_eq(dev_net(pnd->netdev), net))
continue;
if (dev_idx > dev_start_idx) if (dev_idx > dev_start_idx)
addr_start_idx = 0; addr_start_idx = 0;
if (dev_idx++ < dev_start_idx) if (dev_idx++ < dev_start_idx)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment