]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/core/neighbour.c
[NET] NETNS: Omit namespace comparision without CONFIG_NET_NS.
[mirror_ubuntu-bionic-kernel.git] / net / core / neighbour.c
index de654ea8a9442c2d8bba7d5cbf6930730f7ff515..857915a12c15d67c2b87da2cfa499c283dbce918 100644 (file)
@@ -388,7 +388,7 @@ struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, struct net *net,
        hash_val = tbl->hash(pkey, NULL);
        for (n = tbl->hash_buckets[hash_val & tbl->hash_mask]; n; n = n->next) {
                if (!memcmp(n->primary_key, pkey, key_len) &&
-                   dev_net(n->dev) == net) {
+                   net_eq(dev_net(n->dev), net)) {
                        neigh_hold(n);
                        NEIGH_CACHE_STAT_INC(tbl, hits);
                        break;
@@ -483,7 +483,7 @@ struct pneigh_entry * pneigh_lookup(struct neigh_table *tbl,
 
        for (n = tbl->phash_buckets[hash_val]; n; n = n->next) {
                if (!memcmp(n->key, pkey, key_len) &&
-                   (pneigh_net(n) == net) &&
+                   net_eq(pneigh_net(n), net) &&
                    (n->dev == dev || !n->dev)) {
                        read_unlock_bh(&tbl->lock);
                        goto out;
@@ -542,7 +542,7 @@ int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *pkey,
        for (np = &tbl->phash_buckets[hash_val]; (n = *np) != NULL;
             np = &n->next) {
                if (!memcmp(n->key, pkey, key_len) && n->dev == dev &&
-                   (pneigh_net(n) == net)) {
+                   net_eq(pneigh_net(n), net)) {
                        *np = n->next;
                        write_unlock_bh(&tbl->lock);
                        if (tbl->pdestructor)
@@ -1286,7 +1286,7 @@ static inline struct neigh_parms *lookup_neigh_params(struct neigh_table *tbl,
        struct neigh_parms *p;
 
        for (p = &tbl->parms; p; p = p->next) {
-               if ((p->dev && p->dev->ifindex == ifindex && neigh_parms_net(p) == net) ||
+               if ((p->dev && p->dev->ifindex == ifindex && net_eq(neigh_parms_net(p), net)) ||
                    (!p->dev && !ifindex))
                        return p;
        }
@@ -1964,7 +1964,7 @@ static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
                        break;
 
                for (nidx = 0, p = tbl->parms.next; p; p = p->next) {
-                       if (net != neigh_parms_net(p))
+                       if (!net_eq(neigh_parms_net(p), net))
                                continue;
 
                        if (nidx++ < neigh_skip)
@@ -2161,7 +2161,7 @@ static struct neighbour *neigh_get_first(struct seq_file *seq)
                n = tbl->hash_buckets[bucket];
 
                while (n) {
-                       if (dev_net(n->dev) != net)
+                       if (!net_eq(dev_net(n->dev), net))
                                goto next;
                        if (state->neigh_sub_iter) {
                                loff_t fakep = 0;
@@ -2204,7 +2204,7 @@ static struct neighbour *neigh_get_next(struct seq_file *seq,
 
        while (1) {
                while (n) {
-                       if (dev_net(n->dev) != net)
+                       if (!net_eq(dev_net(n->dev), net))
                                goto next;
                        if (state->neigh_sub_iter) {
                                void *v = state->neigh_sub_iter(state, n, pos);
@@ -2260,7 +2260,7 @@ static struct pneigh_entry *pneigh_get_first(struct seq_file *seq)
        state->flags |= NEIGH_SEQ_IS_PNEIGH;
        for (bucket = 0; bucket <= PNEIGH_HASHMASK; bucket++) {
                pn = tbl->phash_buckets[bucket];
-               while (pn && (pneigh_net(pn) != net))
+               while (pn && !net_eq(pneigh_net(pn), net))
                        pn = pn->next;
                if (pn)
                        break;
@@ -2283,7 +2283,7 @@ static struct pneigh_entry *pneigh_get_next(struct seq_file *seq,
                if (++state->bucket > PNEIGH_HASHMASK)
                        break;
                pn = tbl->phash_buckets[state->bucket];
-               while (pn && (pneigh_net(pn) != net))
+               while (pn && !net_eq(pneigh_net(pn), net))
                        pn = pn->next;
                if (pn)
                        break;