提交 a3f5ee71 编写于 作者: L Li RongQing 提交者: David S. Miller

bridge: use list_for_each_entry_continue_reverse

use list_for_each_entry_continue_reverse to rollback in fdb_add_hw
when add address failed
Signed-off-by: NLi RongQing <roy.qing.li@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 545a112b
...@@ -93,7 +93,7 @@ static void fdb_rcu_free(struct rcu_head *head) ...@@ -93,7 +93,7 @@ static void fdb_rcu_free(struct rcu_head *head)
static void fdb_add_hw(struct net_bridge *br, const unsigned char *addr) static void fdb_add_hw(struct net_bridge *br, const unsigned char *addr)
{ {
int err; int err;
struct net_bridge_port *p, *tmp; struct net_bridge_port *p;
ASSERT_RTNL(); ASSERT_RTNL();
...@@ -107,11 +107,9 @@ static void fdb_add_hw(struct net_bridge *br, const unsigned char *addr) ...@@ -107,11 +107,9 @@ static void fdb_add_hw(struct net_bridge *br, const unsigned char *addr)
return; return;
undo: undo:
list_for_each_entry(tmp, &br->port_list, list) { list_for_each_entry_continue_reverse(p, &br->port_list, list) {
if (tmp == p) if (!br_promisc_port(p))
break; dev_uc_del(p->dev, addr);
if (!br_promisc_port(tmp))
dev_uc_del(tmp->dev, addr);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册