Phonet: do not dump addresses from other namespaces

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by remi.denis-courmont@nokia and committed by David S. Miller bd7df219 d25830e5

+3
+3
net/phonet/pn_netlink.c
··· 123 123 124 124 static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb) 125 125 { 126 + struct net *net = sock_net(skb->sk); 126 127 struct phonet_device *pnd; 127 128 int dev_idx = 0, dev_start_idx = cb->args[0]; 128 129 int addr_idx = 0, addr_start_idx = cb->args[1]; ··· 132 131 list_for_each_entry(pnd, &pndevs.list, list) { 133 132 u8 addr; 134 133 134 + if (!net_eq(dev_net(pnd->netdev), net)) 135 + continue; 135 136 if (dev_idx > dev_start_idx) 136 137 addr_start_idx = 0; 137 138 if (dev_idx++ < dev_start_idx)