bonding: modify only neigh_parms owned by us
authorVeaceslav Falico <vfalico@redhat.com>
Fri, 2 Aug 2013 17:07:39 +0000 (19:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Aug 2013 22:19:04 +0000 (15:19 -0700)
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>
drivers/net/bonding/bond_main.c

index 07f257d44a1e00a67b84a58685c5a2e490ce5ca8..e48cb339c0c6e5b71eb4ec24bef6d4f8238ea665 100644 (file)
@@ -3714,11 +3714,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;
 }