Commit 2b78f9a0 authored by Allan Stephens's avatar Allan Stephens Committed by Paul Gortmaker

tipc: Handle broadcast attempt when no neighboring nodes exist

Adds a check to detect when an attempt is made to send a message
via the broadcast link and no neighboring nodes are currently available
to receive it. Rather than wasting effort passing the message to the
broadcast link and broadcast bearer, who will only throw it away,
TIPC now frees the message immediately and reports success (i.e. the
message has been delivered to all available destinations).
Signed-off-by: default avatarAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent cd3decdf
...@@ -417,13 +417,19 @@ int tipc_bclink_send_msg(struct sk_buff *buf) ...@@ -417,13 +417,19 @@ int tipc_bclink_send_msg(struct sk_buff *buf)
spin_lock_bh(&bc_lock); spin_lock_bh(&bc_lock);
if (!bclink->bcast_nodes.count) {
res = msg_data_sz(buf_msg(buf));
buf_discard(buf);
goto exit;
}
res = tipc_link_send_buf(bcl, buf); res = tipc_link_send_buf(bcl, buf);
if (likely(res > 0)) if (likely(res > 0))
bclink_set_last_sent(); bclink_set_last_sent();
bcl->stats.queue_sz_counts++; bcl->stats.queue_sz_counts++;
bcl->stats.accu_queue_sz += bcl->out_queue_size; bcl->stats.accu_queue_sz += bcl->out_queue_size;
exit:
spin_unlock_bh(&bc_lock); spin_unlock_bh(&bc_lock);
return res; return res;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment