public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta•com>
To: "David S. Miller" <davem@davemloft•net>
Cc: netdev@vger•kernel.org
Subject: [PATCH 2/2] bridge: set flags in RTM_NEWNEIGH message correctly
Date: Fri, 02 Sep 2011 10:22:22 -0700	[thread overview]
Message-ID: <20110902172247.481785452@vyatta.com> (raw)
In-Reply-To: 20110902172220.830228928@vyatta.com

[-- Attachment #1: bridge-newneigh-state.patch --]
[-- Type: text/plain, Size: 1409 bytes --]

The functionality for notification was added with 3.0. kernel
but bridge would always send new neighbour message with state == 0.
The problem is that the notify needs to be done after
the flags on ther forwarding engry are set.

Signed-off-by: Stephen Hemminger <shemminger@vyatta•com>
---

--- a/net/bridge/br_fdb.c	2011-08-26 09:41:25.966304883 -0700
+++ b/net/bridge/br_fdb.c	2011-09-01 17:21:43.755481630 -0700
@@ -347,7 +347,6 @@ static struct net_bridge_fdb_entry *fdb_
 		fdb->is_static = 0;
 		fdb->updated = fdb->used = jiffies;
 		hlist_add_head_rcu(&fdb->hlist, head);
-		fdb_notify(fdb, RTM_NEWNEIGH);
 	}
 	return fdb;
 }
@@ -379,6 +378,7 @@ static int fdb_insert(struct net_bridge
 		return -ENOMEM;
 
 	fdb->is_local = fdb->is_static = 1;
+	fdb_notify(fdb, RTM_NEWNEIGH);
 	return 0;
 }
 
@@ -424,8 +424,11 @@ void br_fdb_update(struct net_bridge *br
 		}
 	} else {
 		spin_lock(&br->hash_lock);
-		if (likely(!fdb_find(head, addr)))
-			fdb_create(head, source, addr);
+		if (!fdb_find(head, addr)) {
+			fdb = fdb_create(head, source, addr);
+			if (fdb)
+				fdb_notify(fdb, RTM_NEWNEIGH);
+		}
 
 		/* else  we lose race and someone else inserts
 		 * it first, don't bother updating
@@ -576,6 +579,8 @@ static int fdb_add_entry(struct net_brid
 		fdb->is_local = fdb->is_static = 1;
 	else if (state & NUD_NOARP)
 		fdb->is_static = 1;
+
+	fdb_notify(fdb, RTM_NEWNEIGH);
 	return 0;
 }
 

      parent reply	other threads:[~2011-09-02 17:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110902172220.830228928@vyatta.com>
2011-09-02 17:22 ` [PATCH 1/2] bridge: leave carrier on for empty bridge Stephen Hemminger
2011-09-02 21:39   ` Nicolas de Pesloüan
2011-09-02 22:11     ` Stephen Hemminger
2011-09-03  2:15       ` Ang Way Chuang
2011-09-03  6:30         ` Stephen Hemminger
2011-09-25  8:55         ` Marc Haber
2011-09-03 18:32       ` Nicolas de Pesloüan
2011-09-04  4:14         ` Stephen Hemminger
2011-09-04  7:35           ` Nicolas de Pesloüan
2011-09-04 16:36             ` Stephen Hemminger
2011-09-04 17:12               ` Krzysztof Olędzki
2011-09-05  4:51                 ` Ang Way Chuang
2011-09-05 17:18               ` Nicolas de Pesloüan
2011-09-05 17:57                 ` Stephen Hemminger
2011-09-05 19:02                   ` Ang Way Chuang
2011-09-05 22:45                     ` Stephen Hemminger
2011-09-06  6:52                   ` Nicolas de Pesloüan
2011-09-25  9:16                     ` Marc Haber
2011-09-25 20:10                       ` Nicolas de Pesloüan
2011-09-25  9:05             ` Marc Haber
2011-09-02 17:22 ` Stephen Hemminger [this message]

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=20110902172247.481785452@vyatta.com \
    --to=shemminger@vyatta$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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