]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
IB/sdp: disable timewait on close if socket has been disconnected
authorMichael S. Tsirkin <mst@mellanox.co.il>
Mon, 11 Sep 2006 13:00:21 +0000 (16:00 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:04:00 +0000 (05:04 -0700)
State should move to CLOSE or CLOSE_WAIT etc on disconnect.
Since it currently doesn't, do it in sdp_close to avoid timewait.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_main.c

index 20e5f47fc524e527dc16de2e71284538e7888b15..366f4f5026bd95f7c86482d2cbe681bc70615ae3 100644 (file)
@@ -373,6 +373,11 @@ static void sdp_close(struct sock *sk, long timeout)
                sdp_post_sends(sdp_sk(sk), 0);
        }
 
+       /* TODO: state should move to CLOSE or CLOSE_WAIT etc on disconnect.
+          Since it currently doesn't, do it here to avoid blocking below. */
+       if (!sdp_sk(sk)->id)
+               sdp_set_state(sk, TCP_CLOSE);
+
        sk_stream_wait_close(sk, timeout);
 
 adjudge_to_death: