Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298761
b: refs/heads/master
c: 234bcf8
h: refs/heads/master
i:
  298759: b45a8c6
v: v3
  • Loading branch information
Shlomo Pongratz authored and David S. Miller committed Apr 4, 2012
1 parent 430129c commit 88c2b0d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2af73d4b2afe826d23e83f3747f850eefbd867ff
refs/heads/master: 234bcf8a499ee206145c7007d12d9706a254f790
51 changes: 43 additions & 8 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3704,17 +3704,52 @@ static void bond_set_multicast_list(struct net_device *bond_dev)
read_unlock(&bond->lock);
}

static int bond_neigh_setup(struct net_device *dev, struct neigh_parms *parms)
static int bond_neigh_init(struct neighbour *n)
{
struct bonding *bond = netdev_priv(dev);
struct bonding *bond = netdev_priv(n->dev);
struct slave *slave = bond->first_slave;
const struct net_device_ops *slave_ops;
struct neigh_parms parms;
int ret;

if (!slave)
return 0;

slave_ops = slave->dev->netdev_ops;

if (!slave_ops->ndo_neigh_setup)
return 0;

parms.neigh_setup = NULL;
parms.neigh_cleanup = NULL;
ret = slave_ops->ndo_neigh_setup(slave->dev, &parms);
if (ret)
return ret;

/*
* Assign slave's neigh_cleanup to neighbour in case cleanup is called
* after the last slave has been detached. Assumes that all slaves
* utilize the same neigh_cleanup (true at this writing as only user
* is ipoib).
*/
n->parms->neigh_cleanup = parms.neigh_cleanup;

if (!parms.neigh_setup)
return 0;

return parms.neigh_setup(n);
}

/*
* The bonding ndo_neigh_setup is called at init time beofre any
* slave exists. So we must declare proxy setup function which will
* be used at run time to resolve the actual slave neigh param setup.
*/
static int bond_neigh_setup(struct net_device *dev,
struct neigh_parms *parms)
{
parms->neigh_setup = bond_neigh_init;

if (slave) {
const struct net_device_ops *slave_ops
= slave->dev->netdev_ops;
if (slave_ops->ndo_neigh_setup)
return slave_ops->ndo_neigh_setup(slave->dev, parms);
}
return 0;
}

Expand Down

0 comments on commit 88c2b0d

Please sign in to comment.