Skip to content

Commit

Permalink
Phonet: do not dump addresses from other namespaces
Browse files Browse the repository at this point in the history
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
remi.denis-courmont@nokia authored and David S. Miller committed Dec 3, 2008
1 parent d25830e commit bd7df21
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/phonet/pn_netlink.c
Original file line number Diff line number Diff line change
@@ -123,6 +123,7 @@ static int fill_addr(struct sk_buff *skb, struct net_device *dev, u8 addr,

static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
{
struct net *net = sock_net(skb->sk);
struct phonet_device *pnd;
int dev_idx = 0, dev_start_idx = cb->args[0];
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)
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)

0 comments on commit bd7df21

Please sign in to comment.