netns: fix proxy ARP entries listing on a netns
authorJorge Boncompte [DTI2] <jorge@dti2.net>
Fri, 25 Nov 2011 18:24:49 +0000 (13:24 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Nov 2011 18:24:49 +0000 (13:24 -0500)
Skip entries from foreign network namespaces.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c

index 039d51e6c284e7ab655319d399b9d40060357dcf..5ac07d31fbc9e395abf71ae46c897b5db3c7d6f8 100644 (file)
@@ -2397,7 +2397,10 @@ static struct pneigh_entry *pneigh_get_next(struct seq_file *seq,
        struct net *net = seq_file_net(seq);
        struct neigh_table *tbl = state->tbl;
 
-       pn = pn->next;
+       do {
+               pn = pn->next;
+       } while (pn && !net_eq(pneigh_net(pn), net));
+
        while (!pn) {
                if (++state->bucket > PNEIGH_HASHMASK)
                        break;