* [PATCH net-next] bridge: Add fdb dst check during fdb update
@ 2013-04-14 4:58 roopa
2013-04-14 15:00 ` Cong Wang
0 siblings, 1 reply; 2+ messages in thread
From: roopa @ 2013-04-14 4:58 UTC (permalink / raw)
To: davem, stephen, netdev, roopa; +Cc: nolan, shm, wkok
From: roopa <roopa@cumulusnetworks.com>
Current bridge fdb update code does not seem to update the port
during fdb update. This patch adds a check for fdb dst (port)
change during fdb update. Also rearranges the call to
fdb_notify to send only one notification for create and update.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
net/bridge/br_fdb.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index c581f12..7a7d920 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -615,6 +615,7 @@ static int fdb_add_entry(struct net_bridge_port *source, const __u8 *addr,
struct net_bridge *br = source->br;
struct hlist_head *head = &br->hash[br_mac_hash(addr, vid)];
struct net_bridge_fdb_entry *fdb;
+ int notify = 0;
fdb = fdb_find(head, addr, vid);
if (fdb == NULL) {
@@ -624,7 +625,7 @@ static int fdb_add_entry(struct net_bridge_port *source, const __u8 *addr,
fdb = fdb_create(head, source, addr, vid);
if (!fdb)
return -ENOMEM;
- fdb_notify(br, fdb, RTM_NEWNEIGH);
+ notify = 1;
} else {
if (flags & NLM_F_EXCL)
return -EEXIST;
@@ -638,7 +639,15 @@ static int fdb_add_entry(struct net_bridge_port *source, const __u8 *addr,
fdb->is_static = 1;
} else
fdb->is_local = fdb->is_static = 0;
+ notify = 1;
+ }
+
+ if (fdb->dst != source) {
+ fdb->dst = source;
+ notify = 1;
+ }
+ if (notify) {
fdb->updated = fdb->used = jiffies;
fdb_notify(br, fdb, RTM_NEWNEIGH);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] bridge: Add fdb dst check during fdb update
2013-04-14 4:58 [PATCH net-next] bridge: Add fdb dst check during fdb update roopa
@ 2013-04-14 15:00 ` Cong Wang
0 siblings, 0 replies; 2+ messages in thread
From: Cong Wang @ 2013-04-14 15:00 UTC (permalink / raw)
To: netdev
On Sun, 14 Apr 2013 at 04:58 GMT, roopa@cumulusnetworks.com <roopa@cumulusnetworks.com> wrote:
> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
> index c581f12..7a7d920 100644
> --- a/net/bridge/br_fdb.c
> +++ b/net/bridge/br_fdb.c
> @@ -615,6 +615,7 @@ static int fdb_add_entry(struct net_bridge_port *source, const __u8 *addr,
> struct net_bridge *br = source->br;
> struct hlist_head *head = &br->hash[br_mac_hash(addr, vid)];
> struct net_bridge_fdb_entry *fdb;
> + int notify = 0;
Make it 'bool'.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-14 15:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-14 4:58 [PATCH net-next] bridge: Add fdb dst check during fdb update roopa
2013-04-14 15:00 ` Cong Wang
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).