Commit fa2bae2d authored by Allan Stephens's avatar Allan Stephens Committed by Paul Gortmaker
Browse files

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: default avatarAllan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent a728750e
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -201,16 +201,18 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr)

	/* Accept discovery message & send response, if necessary */
	link_fully_up = link_working_working(link);
	tipc_node_unlock(n_ptr);
	if ((type == DSC_RESP_MSG) || link_fully_up)
		return;

	if ((type == DSC_REQ_MSG) && !link_fully_up) {
		rbuf = tipc_disc_init_msg(DSC_RESP_MSG, orig, b_ptr);
	if (rbuf != NULL) {
		if (rbuf) {
			b_ptr->media->send_msg(rbuf, b_ptr, &media_addr);
			buf_discard(rbuf);
		}
	}

	tipc_node_unlock(n_ptr);
}

/**
 * tipc_disc_stop_link_req - stop sending periodic link setup requests
 * @req: ptr to link request structure