]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: recvmsg should be able to run even if sock is in closing state
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Fri, 15 Jul 2016 19:38:19 +0000 (16:38 -0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Jul 2016 05:02:09 +0000 (22:02 -0700)
commit1eaf8468de7a290e488747b7bf75409d02bc126e
tree66fdbac1414cd9a04e5472b37bde439027509267
parentcc5f702cbee23b0ba77f49264bb1a8a4d5c5c2c1
sctp: recvmsg should be able to run even if sock is in closing state

Commit da9339344cda missed to update some other places which checked for
the socket being TCP-style AND Established state, as Closing state has
some overlapping with the previous understanding of Established.

Without this fix, one of the effects is that some already queued rx
messages may not be readable anymore depending on how the association
teared down, and sending may also not be possible if peer initiated the
shutdown.

Also merge two if() blocks into one condition on sctp_sendmsg().

Cc: Xin Long <lucien.xin@gmail.com>
Fixes: da9339344cda ("sctp: sctp should change socket state when shutdown is received")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/socket.c