diff options
author | Allan Stephens <Allan.Stephens@windriver.com> | 2011-02-28 10:56:23 -0500 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2011-03-13 16:35:18 -0400 |
commit | fa2bae2d5bede252445cc457737d00f9036c41c3 (patch) | |
tree | a4f826a7716a4d3c5c14b1e5f957646e03c202f4 /net/tipc/discover.c | |
parent | a728750e4f0c9500741406299f1817022d411d33 (diff) |
tipc: Give Tx of discovery responses priority over link messages
Delay releasing the node lock when processing a neighbor discovery
message until after the optional discovery response message has been
sent. This helps ensure that any link protocol messages sent by a
link endpoint created as a result of a neighbor discovery request
are received after the discovery response is received, thereby
giving the receiving node a chance to create a peer link endpoint to
consume those link protocol messages, if one does not already exist.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/discover.c')
-rw-r--r-- | net/tipc/discover.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c index 2345268ca64b..580b50a79e43 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c | |||
@@ -201,14 +201,16 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr) | |||
201 | 201 | ||
202 | /* Accept discovery message & send response, if necessary */ | 202 | /* Accept discovery message & send response, if necessary */ |
203 | link_fully_up = link_working_working(link); | 203 | link_fully_up = link_working_working(link); |
204 | tipc_node_unlock(n_ptr); | 204 | |
205 | if ((type == DSC_RESP_MSG) || link_fully_up) | 205 | if ((type == DSC_REQ_MSG) && !link_fully_up) { |
206 | return; | 206 | rbuf = tipc_disc_init_msg(DSC_RESP_MSG, orig, b_ptr); |
207 | rbuf = tipc_disc_init_msg(DSC_RESP_MSG, orig, b_ptr); | 207 | if (rbuf) { |
208 | if (rbuf != NULL) { | 208 | b_ptr->media->send_msg(rbuf, b_ptr, &media_addr); |
209 | b_ptr->media->send_msg(rbuf, b_ptr, &media_addr); | 209 | buf_discard(rbuf); |
210 | buf_discard(rbuf); | 210 | } |
211 | } | 211 | } |
212 | |||
213 | tipc_node_unlock(n_ptr); | ||
212 | } | 214 | } |
213 | 215 | ||
214 | /** | 216 | /** |