aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorErik Hugne <erik.hugne@ericsson.com>2015-06-09 11:27:12 -0400
committerDavid S. Miller <davem@davemloft.net>2015-06-11 01:05:20 -0400
commitb3be5e3e726a6cc849f40c70c3ae525e4146e9df (patch)
tree201b8efcf9359813ab77432d88252ce9428cc3b0 /net/tipc
parent1b0ccfe54a6abd1bc4d7bdd1c33e61e2c58f72c7 (diff)
tipc: disconnect socket directly after probe failure
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>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/socket.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 9074b5cede38..f485600c4507 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -2142,11 +2142,17 @@ static void tipc_sk_timeout(unsigned long data)
2142 peer_node = tsk_peer_node(tsk); 2142 peer_node = tsk_peer_node(tsk);
2143 2143
2144 if (tsk->probing_state == TIPC_CONN_PROBING) { 2144 if (tsk->probing_state == TIPC_CONN_PROBING) {
2145 /* Previous probe not answered -> self abort */ 2145 if (!sock_owned_by_user(sk)) {
2146 skb = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE, 2146 sk->sk_socket->state = SS_DISCONNECTING;
2147 TIPC_CONN_MSG, SHORT_H_SIZE, 0, 2147 tsk->connected = 0;
2148 own_node, peer_node, tsk->portid, 2148 tipc_node_remove_conn(sock_net(sk), tsk_peer_node(tsk),
2149 peer_port, TIPC_ERR_NO_PORT); 2149 tsk_peer_port(tsk));
2150 sk->sk_state_change(sk);
2151 } else {
2152 /* Try again later */
2153 sk_reset_timer(sk, &sk->sk_timer, (HZ / 20));
2154 }
2155
2150 } else { 2156 } else {
2151 skb = tipc_msg_create(CONN_MANAGER, CONN_PROBE, 2157 skb = tipc_msg_create(CONN_MANAGER, CONN_PROBE,
2152 INT_H_SIZE, 0, peer_node, own_node, 2158 INT_H_SIZE, 0, peer_node, own_node,