Skip to content

Commit

Permalink
tipc: disconnect socket directly after probe failure
Browse files Browse the repository at this point in the history
If the TIPC connection timer expires in a probing state, a
self abort message is supposed to be generated and delivered
to the local socket. This is currently broken, and the abort
message is actually sent out to the peer node with invalid
addressing information. This will cause the link to enter
a constant retransmission state and eventually reset.
We fix this by removing the self-abort message creation and
tear down connection immediately instead.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Erik Hugne authored and David S. Miller committed Jun 11, 2015
1 parent 1b0ccfe commit b3be5e3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2142,11 +2142,17 @@ static void tipc_sk_timeout(unsigned long data)
peer_node = tsk_peer_node(tsk);

if (tsk->probing_state == TIPC_CONN_PROBING) {
/* Previous probe not answered -> self abort */
skb = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE,
TIPC_CONN_MSG, SHORT_H_SIZE, 0,
own_node, peer_node, tsk->portid,
peer_port, TIPC_ERR_NO_PORT);
if (!sock_owned_by_user(sk)) {
sk->sk_socket->state = SS_DISCONNECTING;
tsk->connected = 0;
tipc_node_remove_conn(sock_net(sk), tsk_peer_node(tsk),
tsk_peer_port(tsk));
sk->sk_state_change(sk);
} else {
/* Try again later */
sk_reset_timer(sk, &sk->sk_timer, (HZ / 20));
}

} else {
skb = tipc_msg_create(CONN_MANAGER, CONN_PROBE,
INT_H_SIZE, 0, peer_node, own_node,
Expand Down

0 comments on commit b3be5e3

Please sign in to comment.