aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@redhat.com>2013-08-02 19:07:39 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-14 06:02:08 -0700
commit71244e7b9f89ee8825f265a821475a553589a726 (patch)
treebd5f3e9b44d2e52f6465f70fbaab3f3707f5f782
parent3b5c0012686fac17b4fac1c11fba65f45bbdbff8 (diff)
bonding: modify only neigh_parms owned by us
[ Upstream commit 9918d5bf329d0dc5bb2d9d293bcb772bdb626e65 ] Otherwise, on neighbour creation, bond_neigh_init() will be called with a foreign netdev. Signed-off-by: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/bonding/bond_main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index d9f83582997..80103bb47ca 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3750,11 +3750,17 @@ static int bond_neigh_init(struct neighbour *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.
+ *
+ * It's also called by master devices (such as vlans) to setup their
+ * underlying devices. In that case - do nothing, we're already set up from
+ * our init.
*/
static int bond_neigh_setup(struct net_device *dev,
struct neigh_parms *parms)
{
- parms->neigh_setup = bond_neigh_init;
+ /* modify only our neigh_parms */
+ if (parms->dev == dev)
+ parms->neigh_setup = bond_neigh_init;
return 0;
}