]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/core/neighbour.c
netdev: add more functions to netdevice ops
[mirror_ubuntu-bionic-kernel.git] / net / core / neighbour.c
index cca6a55909ebbf6cde921a3db6dea67cb5725326..9c3717a23cf76648bd17452bb422f32b91b26ce1 100644 (file)
@@ -1327,9 +1327,9 @@ struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
                                      struct neigh_table *tbl)
 {
        struct neigh_parms *p, *ref;
-       struct net *net;
+       struct net *net = dev_net(dev);
+       const struct net_device_ops *ops = dev->netdev_ops;
 
-       net = dev_net(dev);
        ref = lookup_neigh_params(tbl, net, 0);
        if (!ref)
                return NULL;
@@ -1341,7 +1341,7 @@ struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
                p->reachable_time =
                                neigh_rand_reach_time(p->base_reachable_time);
 
-               if (dev->neigh_setup && dev->neigh_setup(dev, p)) {
+               if (ops->ndo_neigh_setup && ops->ndo_neigh_setup(dev, p)) {
                        kfree(p);
                        return NULL;
                }