Skip to content

Commit

Permalink
tipc: Minor optimization to rejection of connection-based messages
Browse files Browse the repository at this point in the history
Modifies message rejection logic so that TIPC doesn't attempt to
send a FIN message to the rejecting port if it is known in advance
that there is no such message because the rejecting port doesn't exist.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Feb 6, 2012
1 parent 3175bd9 commit dff10e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/tipc/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,16 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)

/* send self-abort message when rejecting on a connected port */
if (msg_connected(msg)) {
struct sk_buff *abuf = NULL;
struct tipc_port *p_ptr = tipc_port_lock(msg_destport(msg));

if (p_ptr) {
struct sk_buff *abuf = NULL;

if (p_ptr->connected)
abuf = port_build_self_abort_msg(p_ptr, err);
tipc_port_unlock(p_ptr);
tipc_net_route_msg(abuf);
}
tipc_net_route_msg(abuf);
}

/* send returned message & dispose of rejected message */
Expand Down

0 comments on commit dff10e9

Please sign in to comment.