Xin Long cda91d5b91 sctp: cancel a blocking accept when shutdown a listen socket
As David Laight noticed,

"In a multithreaded program it is reasonable to have a thread blocked in
 accept(). With TCP a subsequent shutdown(listen_fd, SHUT_RDWR) causes
 the accept to fail. But nothing happens for SCTP."

sctp_disconnect() is eventually called when shutdown a listen socket,
but nothing is done in this function. This patch sets RCV_SHUTDOWN
flag in sk->sk_shutdown there, and adds the check (sk->sk_shutdown &
RCV_SHUTDOWN) to break and return in sctp_accept().

Note that shutdown() is only supported on TCP-style SCTP socket.

Reported-by: David Laight <David.Laight@aculab.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-07-03 09:45:39 +01:00
..
2024-05-29 09:25:15 -07:00
2024-06-14 19:08:50 -07:00
2024-07-02 18:59:33 -07:00
2024-06-05 10:18:06 +01:00
2024-07-02 18:59:33 -07:00
2024-05-28 07:27:29 -07:00
2024-06-27 13:53:43 -07:00
2024-07-01 09:52:35 +01:00
2024-06-17 13:14:09 +01:00
2024-06-22 13:55:56 -07:00
2024-06-27 13:53:43 -07:00