From: Veaceslav Falico Date: Fri, 2 Aug 2013 17:07:39 +0000 (+0200) Subject: bonding: modify only neigh_parms owned by us X-Git-Tag: firefly_0821_release~6453^2~904 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=92986ce4e59db8c4c44caf9633095ab07f1d79f5;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index f97569613526..666cf3a49b6d 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3770,11 +3770,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; }