Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193604
b: refs/heads/master
c: 1a62483
h: refs/heads/master
v: v3
  • Loading branch information
Neil Horman authored and David S. Miller committed Mar 17, 2010
1 parent 85aacb7 commit 0d48b00
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 10708f37ae729baba9b67bd134c3720709d4ae62
refs/heads/master: 1a624832a06b465d0e5651901bcbc3680c78d374
35 changes: 14 additions & 21 deletions trunk/net/tipc/bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,7 @@ static int tipc_bcbearer_send(struct sk_buff *buf,
struct tipc_bearer *unused1,
struct tipc_media_addr *unused2)
{
static int send_count = 0;

int bp_index;
int swap_time;

/* Prepare buffer for broadcasting (if first time trying to send it) */

Expand All @@ -575,11 +572,6 @@ static int tipc_bcbearer_send(struct sk_buff *buf,
msg_set_mc_netid(msg, tipc_net_id);
}

/* Determine if bearer pairs should be swapped following this attempt */

if ((swap_time = (++send_count >= 10)))
send_count = 0;

/* Send buffer over bearers until all targets reached */

bcbearer->remains = tipc_cltr_bcast_nodes;
Expand All @@ -595,21 +587,22 @@ static int tipc_bcbearer_send(struct sk_buff *buf,
if (bcbearer->remains_new.count == bcbearer->remains.count)
continue; /* bearer pair doesn't add anything */

if (!p->publ.blocked &&
!p->media->send_msg(buf, &p->publ, &p->media->bcast_addr)) {
if (swap_time && s && !s->publ.blocked)
goto swap;
else
goto update;
if (p->publ.blocked ||
p->media->send_msg(buf, &p->publ, &p->media->bcast_addr)) {
/* unable to send on primary bearer */
if (!s || s->publ.blocked ||
s->media->send_msg(buf, &s->publ,
&s->media->bcast_addr)) {
/* unable to send on either bearer */
continue;
}
}

if (s) {
bcbearer->bpairs[bp_index].primary = s;
bcbearer->bpairs[bp_index].secondary = p;
}

if (!s || s->publ.blocked ||
s->media->send_msg(buf, &s->publ, &s->media->bcast_addr))
continue; /* unable to send using bearer pair */
swap:
bcbearer->bpairs[bp_index].primary = s;
bcbearer->bpairs[bp_index].secondary = p;
update:
if (bcbearer->remains_new.count == 0)
return 0;

Expand Down

0 comments on commit 0d48b00

Please sign in to comment.