提交 7597b266 编写于 作者: N Nikolay Aleksandrov 提交者: David S. Miller

bridge: allow ext learned entries to change ports

current code silently ignores change of port in the request
message. This patch makes sure the port is modified and
notification is sent to userspace.

Fixes: cf6b8e1e ("bridge: add API to notify bridge driver of learned FBD on offloaded device")
Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e05a90ec
......@@ -1079,8 +1079,9 @@ void br_fdb_unsync_static(struct net_bridge *br, struct net_bridge_port *p)
int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
const unsigned char *addr, u16 vid)
{
struct hlist_head *head;
struct net_bridge_fdb_entry *fdb;
struct hlist_head *head;
bool modified = false;
int err = 0;
spin_lock_bh(&br->hash_lock);
......@@ -1095,13 +1096,24 @@ int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
}
fdb->added_by_external_learn = 1;
fdb_notify(br, fdb, RTM_NEWNEIGH);
} else if (fdb->added_by_external_learn) {
} else {
fdb->updated = jiffies;
if (fdb->dst != p) {
fdb->dst = p;
modified = true;
}
if (fdb->added_by_external_learn) {
/* Refresh entry */
fdb->updated = fdb->used = jiffies;
fdb->used = jiffies;
} else if (!fdb->added_by_user) {
/* Take over SW learned entry */
fdb->added_by_external_learn = 1;
fdb->updated = jiffies;
modified = true;
}
if (modified)
fdb_notify(br, fdb, RTM_NEWNEIGH);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册