Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 503eebc2 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

net: add dev arg to ndo_neigh_construct/destroy



As the following patch will allow upper devices to follow the call down
lower devices, we need to add dev here and not rely on n->dev.

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9046a745
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1996,7 +1996,8 @@ static int rocker_port_change_proto_down(struct net_device *dev,
	return 0;
	return 0;
}
}


static void rocker_port_neigh_destroy(struct neighbour *n)
static void rocker_port_neigh_destroy(struct net_device *dev,
				      struct neighbour *n)
{
{
	struct rocker_port *rocker_port = netdev_priv(n->dev);
	struct rocker_port *rocker_port = netdev_priv(n->dev);
	int err;
	int err;
+4 −2
Original line number Original line Diff line number Diff line
@@ -1209,8 +1209,10 @@ struct net_device_ops {
						    netdev_features_t features);
						    netdev_features_t features);
	int			(*ndo_set_features)(struct net_device *dev,
	int			(*ndo_set_features)(struct net_device *dev,
						    netdev_features_t features);
						    netdev_features_t features);
	int			(*ndo_neigh_construct)(struct neighbour *n);
	int			(*ndo_neigh_construct)(struct net_device *dev,
	void			(*ndo_neigh_destroy)(struct neighbour *n);
						       struct neighbour *n);
	void			(*ndo_neigh_destroy)(struct net_device *dev,
						     struct neighbour *n);


	int			(*ndo_fdb_add)(struct ndmsg *ndm,
	int			(*ndo_fdb_add)(struct ndmsg *ndm,
					       struct nlattr *tb[],
					       struct nlattr *tb[],
+1 −1
Original line number Original line Diff line number Diff line
@@ -286,7 +286,7 @@ static const struct neigh_ops clip_neigh_ops = {
	.connected_output =	neigh_direct_output,
	.connected_output =	neigh_direct_output,
};
};


static int clip_constructor(struct neighbour *neigh)
static int clip_constructor(struct net_device *dev, struct neighbour *neigh)
{
{
	struct atmarp_entry *entry = neighbour_priv(neigh);
	struct atmarp_entry *entry = neighbour_priv(neigh);


+2 −2
Original line number Original line Diff line number Diff line
@@ -473,7 +473,7 @@ struct neighbour *__neigh_create(struct neigh_table *tbl, const void *pkey,
	}
	}


	if (dev->netdev_ops->ndo_neigh_construct) {
	if (dev->netdev_ops->ndo_neigh_construct) {
		error = dev->netdev_ops->ndo_neigh_construct(n);
		error = dev->netdev_ops->ndo_neigh_construct(dev, n);
		if (error < 0) {
		if (error < 0) {
			rc = ERR_PTR(error);
			rc = ERR_PTR(error);
			goto out_neigh_release;
			goto out_neigh_release;
@@ -701,7 +701,7 @@ void neigh_destroy(struct neighbour *neigh)
	neigh->arp_queue_len_bytes = 0;
	neigh->arp_queue_len_bytes = 0;


	if (dev->netdev_ops->ndo_neigh_destroy)
	if (dev->netdev_ops->ndo_neigh_destroy)
		dev->netdev_ops->ndo_neigh_destroy(neigh);
		dev->netdev_ops->ndo_neigh_destroy(dev, neigh);


	dev_put(dev);
	dev_put(dev);
	neigh_parms_put(neigh->parms);
	neigh_parms_put(neigh->parms);
+1 −1
Original line number Original line Diff line number Diff line
@@ -81,7 +81,7 @@ static int lowpan_stop(struct net_device *dev)
	return 0;
	return 0;
}
}


static int lowpan_neigh_construct(struct neighbour *n)
static int lowpan_neigh_construct(struct net_device *dev, struct neighbour *n)
{
{
	struct lowpan_802154_neigh *neigh = lowpan_802154_neigh(neighbour_priv(n));
	struct lowpan_802154_neigh *neigh = lowpan_802154_neigh(neighbour_priv(n));