diff options
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/bcast.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index d890d480ae3b..dd13bfa09333 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -637,6 +637,7 @@ static int tipc_bcbearer_send(struct sk_buff *buf, struct tipc_bearer *unused1, | |||
637 | struct tipc_media_addr *unused2) | 637 | struct tipc_media_addr *unused2) |
638 | { | 638 | { |
639 | int bp_index; | 639 | int bp_index; |
640 | struct tipc_msg *msg = buf_msg(buf); | ||
640 | 641 | ||
641 | /* Prepare broadcast link message for reliable transmission, | 642 | /* Prepare broadcast link message for reliable transmission, |
642 | * if first time trying to send it; | 643 | * if first time trying to send it; |
@@ -644,10 +645,7 @@ static int tipc_bcbearer_send(struct sk_buff *buf, struct tipc_bearer *unused1, | |||
644 | * since they are sent in an unreliable manner and don't need it | 645 | * since they are sent in an unreliable manner and don't need it |
645 | */ | 646 | */ |
646 | if (likely(!msg_non_seq(buf_msg(buf)))) { | 647 | if (likely(!msg_non_seq(buf_msg(buf)))) { |
647 | struct tipc_msg *msg; | ||
648 | |||
649 | bcbuf_set_acks(buf, bclink->bcast_nodes.count); | 648 | bcbuf_set_acks(buf, bclink->bcast_nodes.count); |
650 | msg = buf_msg(buf); | ||
651 | msg_set_non_seq(msg, 1); | 649 | msg_set_non_seq(msg, 1); |
652 | msg_set_mc_netid(msg, tipc_net_id); | 650 | msg_set_mc_netid(msg, tipc_net_id); |
653 | bcl->stats.sent_info++; | 651 | bcl->stats.sent_info++; |
@@ -664,12 +662,14 @@ static int tipc_bcbearer_send(struct sk_buff *buf, struct tipc_bearer *unused1, | |||
664 | for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) { | 662 | for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) { |
665 | struct tipc_bearer *p = bcbearer->bpairs[bp_index].primary; | 663 | struct tipc_bearer *p = bcbearer->bpairs[bp_index].primary; |
666 | struct tipc_bearer *s = bcbearer->bpairs[bp_index].secondary; | 664 | struct tipc_bearer *s = bcbearer->bpairs[bp_index].secondary; |
667 | struct tipc_bearer *b = p; | 665 | struct tipc_bearer *bp[2] = {p, s}; |
666 | struct tipc_bearer *b = bp[msg_link_selector(msg)]; | ||
668 | struct sk_buff *tbuf; | 667 | struct sk_buff *tbuf; |
669 | 668 | ||
670 | if (!p) | 669 | if (!p) |
671 | break; /* No more bearers to try */ | 670 | break; /* No more bearers to try */ |
672 | 671 | if (!b) | |
672 | b = p; | ||
673 | tipc_nmap_diff(&bcbearer->remains, &b->nodes, | 673 | tipc_nmap_diff(&bcbearer->remains, &b->nodes, |
674 | &bcbearer->remains_new); | 674 | &bcbearer->remains_new); |
675 | if (bcbearer->remains_new.count == bcbearer->remains.count) | 675 | if (bcbearer->remains_new.count == bcbearer->remains.count) |
@@ -686,13 +686,6 @@ static int tipc_bcbearer_send(struct sk_buff *buf, struct tipc_bearer *unused1, | |||
686 | tipc_bearer_send(b->identity, tbuf, &b->bcast_addr); | 686 | tipc_bearer_send(b->identity, tbuf, &b->bcast_addr); |
687 | kfree_skb(tbuf); /* Bearer keeps a clone */ | 687 | kfree_skb(tbuf); /* Bearer keeps a clone */ |
688 | } | 688 | } |
689 | |||
690 | /* Swap bearers for next packet */ | ||
691 | if (s) { | ||
692 | bcbearer->bpairs[bp_index].primary = s; | ||
693 | bcbearer->bpairs[bp_index].secondary = p; | ||
694 | } | ||
695 | |||
696 | if (bcbearer->remains_new.count == 0) | 689 | if (bcbearer->remains_new.count == 0) |
697 | break; /* All targets reached */ | 690 | break; /* All targets reached */ |
698 | 691 | ||