netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tipc: disconnect socket directly after probe failure
@ 2015-06-09 15:27 erik.hugne
  2015-06-11  5:05 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: erik.hugne @ 2015-06-09 15:27 UTC (permalink / raw)
  To: netdev; +Cc: tipc-discussion

From: Erik Hugne <erik.hugne@ericsson.com>

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>
---
 net/tipc/socket.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 30ea82a..46b6ed5 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -2140,11 +2140,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,
-- 
2.1.4


------------------------------------------------------------------------------

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tipc: disconnect socket directly after probe failure
  2015-06-09 15:27 [PATCH] tipc: disconnect socket directly after probe failure erik.hugne
@ 2015-06-11  5:05 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-06-11  5:05 UTC (permalink / raw)
  To: erik.hugne; +Cc: netdev, tipc-discussion

From: <erik.hugne@ericsson.com>
Date: Tue, 9 Jun 2015 17:27:12 +0200

> From: Erik Hugne <erik.hugne@ericsson.com>
> 
> 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>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-11  5:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-09 15:27 [PATCH] tipc: disconnect socket directly after probe failure erik.hugne
2015-06-11  5:05 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).