[NET] NETNS: Omit net_device->nd_net without CONFIG_NET_NS.
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / core / neighbour.c
index 23c0a10c0c379463258d0a86bf2a4bb0139d84fa..c978bd1cd6592d7bf91b83f03ff24df56ebea9a5 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) &&
-                   (net == n->dev->nd_net)) {
+                   dev_net(n->dev) == net) {
                        neigh_hold(n);
                        NEIGH_CACHE_STAT_INC(tbl, hits);
                        break;
@@ -1298,7 +1298,7 @@ struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
        struct neigh_parms *p, *ref;
        struct net *net;
 
-       net = dev->nd_net;
+       net = dev_net(dev);
        ref = lookup_neigh_params(tbl, net, 0);
        if (!ref)
                return NULL;
@@ -2050,7 +2050,7 @@ static int neigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
                        s_idx = 0;
                for (n = tbl->hash_buckets[h], idx = 0; n; n = n->next) {
                        int lidx;
-                       if (n->dev->nd_net != net)
+                       if (dev_net(n->dev) != net)
                                continue;
                        lidx = idx++;
                        if (lidx < s_idx)
@@ -2155,7 +2155,7 @@ static struct neighbour *neigh_get_first(struct seq_file *seq)
                n = tbl->hash_buckets[bucket];
 
                while (n) {
-                       if (n->dev->nd_net != net)
+                       if (dev_net(n->dev) != net)
                                goto next;
                        if (state->neigh_sub_iter) {
                                loff_t fakep = 0;
@@ -2198,7 +2198,7 @@ static struct neighbour *neigh_get_next(struct seq_file *seq,
 
        while (1) {
                while (n) {
-                       if (n->dev->nd_net != net)
+                       if (dev_net(n->dev) != net)
                                goto next;
                        if (state->neigh_sub_iter) {
                                void *v = state->neigh_sub_iter(state, n, pos);
@@ -2482,7 +2482,7 @@ static inline size_t neigh_nlmsg_size(void)
 
 static void __neigh_notify(struct neighbour *n, int type, int flags)
 {
-       struct net *net = n->dev->nd_net;
+       struct net *net = dev_net(n->dev);
        struct sk_buff *skb;
        int err = -ENOBUFS;