]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: allow receiving msg when TCP-style sk is in CLOSED state
authorXin Long <lucien.xin@gmail.com>
Sat, 30 Jul 2016 06:14:41 +0000 (14:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 31 Jul 2016 05:06:22 +0000 (22:06 -0700)
commitb4e0bb11df8dd1f5c2d8cc8c8d3e09865f812d50
treee738a612df3e51d18ca95d387a1d778483c20f44
parent707174bcb89e8f31946119d025c5fb7e5913d274
sctp: allow receiving msg when TCP-style sk is in CLOSED state

Commit 2cd4ab0cfdf3 ("sctp: change sk state to CLOSED instead of
CLOSING in sctp_sock_migrate") changed sk state to CLOSED if the
assoc is closed when sctp_accept clones a new sk.

If there is still data in sk receive queue, users will not be able
to read it any more, as sctp_recvmsg returns directly if sk state
is CLOSED.

This patch is to add CLOSED state check in sctp_recvmsg to allow
reading data from TCP-style sk with CLOSED state as what TCP does.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/socket.c