Commit 141ddefc authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate

Commit d46e416c ("sctp: sctp should change socket state when
shutdown is received") may set sk_state CLOSING in sctp_sock_migrate,
but inet_accept doesn't allow the sk_state other than ESTABLISHED/
CLOSED for sctp. So we will change sk_state to CLOSED, instead of
CLOSING, as actually sk is closed already there.

Fixes: d46e416c ("sctp: sctp should change socket state when shutdown is received")
Reported-by: default avatarYe Xiaolong <xiaolong.ye@intel.com>
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5fb384b0
...@@ -7568,7 +7568,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, ...@@ -7568,7 +7568,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
* is called, set RCV_SHUTDOWN flag. * is called, set RCV_SHUTDOWN flag.
*/ */
if (sctp_state(assoc, CLOSED) && sctp_style(newsk, TCP)) { if (sctp_state(assoc, CLOSED) && sctp_style(newsk, TCP)) {
newsk->sk_state = SCTP_SS_CLOSING; newsk->sk_state = SCTP_SS_CLOSED;
newsk->sk_shutdown |= RCV_SHUTDOWN; newsk->sk_shutdown |= RCV_SHUTDOWN;
} else { } else {
newsk->sk_state = SCTP_SS_ESTABLISHED; newsk->sk_state = SCTP_SS_ESTABLISHED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment