From 7f8843c2689d0baf4ed93a3ef465a6c86f872cbb Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Mon, 11 Sep 2006 16:00:21 +0300 Subject: [PATCH] IB/sdp: disable timewait on close if socket has been disconnected 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 --- drivers/infiniband/ulp/sdp/sdp_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/sdp_main.c index 20e5f47fc524..366f4f5026bd 100644 --- a/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/drivers/infiniband/ulp/sdp/sdp_main.c @@ -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: -- 2.50.1