diff options
author | Gerlando Falauto <gerlando.falauto@keymile.com> | 2013-05-01 12:04:45 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-03 16:08:58 -0400 |
commit | 77861d9c00900c0105b9d66ecf9fa612a43f8df5 (patch) | |
tree | f08234774c2d6aa579b3de70c0ff3d8b630f1186 /net/tipc/bcast.c | |
parent | e616071094c214a274fb66d0b297f8b25a1a34d7 (diff) | |
download | linux-3.10-77861d9c00900c0105b9d66ecf9fa612a43f8df5.tar.gz linux-3.10-77861d9c00900c0105b9d66ecf9fa612a43f8df5.tar.bz2 linux-3.10-77861d9c00900c0105b9d66ecf9fa612a43f8df5.zip |
tipc: tipc_bcbearer_send(): simplify bearer selection
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/bcast.c')
-rw-r--r-- | net/tipc/bcast.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 0e2f4324f54..d9d848d488e 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -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) { |