netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Veaceslav Falico <vfalico@redhat.com>
To: netdev@vger.kernel.org
Cc: vfalico@redhat.com, fubar@us.ibm.com, andy@greyhouse.net,
	ebiederm@xmission.com, joe@perches.com
Subject: [PATCH net-next 2/2] bonding: modify only neigh_parms owned by us
Date: Fri,  2 Aug 2013 19:07:39 +0200	[thread overview]
Message-ID: <1375463259-12033-3-git-send-email-vfalico@redhat.com> (raw)
In-Reply-To: <1375463259-12033-1-git-send-email-vfalico@redhat.com>

Otherwise, on neighbour creation, bond_neigh_init() will be called with a
foreign netdev.

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
 drivers/net/bonding/bond_main.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 1d37a96..476df7d 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3630,11 +3630,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;
 }
-- 
1.7.1

  parent reply	other threads:[~2013-08-02 17:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02 17:07 [PATCH net-next 0/2] fix bonding neighbour setup handling Veaceslav Falico
2013-08-02 17:07 ` [PATCH net-next 1/2] neighbour: populate neigh_parms on alloc before calling ndo_neigh_setup Veaceslav Falico
2013-08-02 17:07 ` Veaceslav Falico [this message]
2013-08-02 22:45 ` [PATCH net-next 0/2] fix bonding neighbour setup handling David Miller
2013-08-05 13:49   ` Nikolay Aleksandrov
2013-08-05 22:25     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375463259-12033-3-git-send-email-vfalico@redhat.com \
    --to=vfalico@redhat.com \
    --cc=andy@greyhouse.net \
    --cc=ebiederm@xmission.com \
    --cc=fubar@us.ibm.com \
    --cc=joe@perches.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).