提交 77861d9c 编写于 作者: G Gerlando Falauto 提交者: David S. Miller

tipc: tipc_bcbearer_send(): simplify bearer selection

Signed-off-by: NGerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e6160710
......@@ -610,23 +610,23 @@ static int tipc_bcbearer_send(struct sk_buff *buf,
for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) {
struct tipc_bearer *p = bcbearer->bpairs[bp_index].primary;
struct tipc_bearer *s = bcbearer->bpairs[bp_index].secondary;
struct tipc_bearer *b = p;
if (!p)
break; /* No more bearers to try */
tipc_nmap_diff(&bcbearer->remains, &p->nodes,
if (tipc_bearer_blocked(p)) {
if (!s || tipc_bearer_blocked(s))
continue; /* Can't use either bearer */
b = s;
}
tipc_nmap_diff(&bcbearer->remains, &b->nodes,
&bcbearer->remains_new);
if (bcbearer->remains_new.count == bcbearer->remains.count)
continue; /* Nothing added by bearer pair */
if (!tipc_bearer_blocked(p))
tipc_bearer_send(p, buf, &p->bcast_addr);
else if (s && !tipc_bearer_blocked(s))
/* unable to send on primary bearer */
tipc_bearer_send(s, buf, &s->bcast_addr);
else
/* unable to send on either bearer */
continue;
tipc_bearer_send(b, buf, &b->bcast_addr);
/* Swap bearers for next packet */
if (s) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册