From e8919e3a03e4e12975ed91d467e312098d118bfc Mon Sep 17 00:00:00 2001 From: stephen hemminger Date: Tue, 6 Dec 2011 13:02:24 +0000 Subject: [PATCH] --- yaml --- r: 278509 b: refs/heads/master c: f58ee4e1a28b68ad94130a747d676cbc6644dbd1 h: refs/heads/master i: 278507: f03ab77902f8ebf41333aa5a85456a527eeb2d19 v: v3 --- [refs] | 2 +- trunk/net/bridge/br_fdb.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 801d8a080345..5adaf89ed732 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f33f1fccbf67b3d9b310a4b09114b7c670320ad4 +refs/heads/master: f58ee4e1a28b68ad94130a747d676cbc6644dbd1 diff --git a/trunk/net/bridge/br_fdb.c b/trunk/net/bridge/br_fdb.c index 973813e34428..d9ca85b87971 100644 --- a/trunk/net/bridge/br_fdb.c +++ b/trunk/net/bridge/br_fdb.c @@ -347,7 +347,6 @@ static struct net_bridge_fdb_entry *fdb_create(struct hlist_head *head, 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 *br, struct net_bridge_port *source, return -ENOMEM; fdb->is_local = fdb->is_static = 1; + fdb_notify(fdb, RTM_NEWNEIGH); return 0; } @@ -424,9 +424,11 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, } } else { spin_lock(&br->hash_lock); - if (likely(!fdb_find(head, addr))) - fdb_create(head, source, addr); - + if (likely(!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 */ @@ -572,6 +574,7 @@ static int fdb_add_entry(struct net_bridge_port *source, const __u8 *addr, fdb = fdb_create(head, source, addr); if (!fdb) return -ENOMEM; + fdb_notify(fdb, RTM_NEWNEIGH); } else { if (flags & NLM_F_EXCL) return -EEXIST;