From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] sctp: allow delivering notifications after receiving SHUTDOWN Date: Sat, 30 Jul 2016 22:07:03 -0700 (PDT) Message-ID: <20160730.220703.417829793602387422.davem@davemloft.net> References: Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linux-sctp@vger.kernel.org, marcelo.leitner@gmail.com, vyasevich@gmail.com, daniel@iogearbox.net To: lucien.xin@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:51890 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750748AbcGaFHH (ORCPT ); Sun, 31 Jul 2016 01:07:07 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Xin Long Date: Sat, 30 Jul 2016 14:09:09 +0800 > Prior to this patch, once sctp received SHUTDOWN or shutdown with RD, > sk->sk_shutdown would be set with RCV_SHUTDOWN, and all events would > be dropped in sctp_ulpq_tail_event(). It would cause: > > 1. some notifications couldn't be received by users. like > SCTP_SHUTDOWN_COMP generated by sctp_sf_do_4_C(). > > 2. sctp would also never trigger sk_data_ready when the association > was closed, making it harder to identify the end of the association > by calling recvmsg() and getting an EOF. It was not convenient for > kernel users. > > The check here should be stopping delivering DATA chunks after receiving > SHUTDOWN, and stopping delivering ANY chunks after sctp_close(). > > So this patch is to allow notifications to enqueue into receive queue > even if sk->sk_shutdown is set to RCV_SHUTDOWN in sctp_ulpq_tail_event, > but if sk->sk_shutdown == RCV_SHUTDOWN | SEND_SHUTDOWN, it drops all > events. > > Signed-off-by: Xin Long Applied. From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Date: Sun, 31 Jul 2016 05:07:03 +0000 Subject: Re: [PATCH net] sctp: allow delivering notifications after receiving SHUTDOWN Message-Id: <20160730.220703.417829793602387422.davem@davemloft.net> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lucien.xin@gmail.com Cc: netdev@vger.kernel.org, linux-sctp@vger.kernel.org, marcelo.leitner@gmail.com, vyasevich@gmail.com, daniel@iogearbox.net From: Xin Long Date: Sat, 30 Jul 2016 14:09:09 +0800 > Prior to this patch, once sctp received SHUTDOWN or shutdown with RD, > sk->sk_shutdown would be set with RCV_SHUTDOWN, and all events would > be dropped in sctp_ulpq_tail_event(). It would cause: > > 1. some notifications couldn't be received by users. like > SCTP_SHUTDOWN_COMP generated by sctp_sf_do_4_C(). > > 2. sctp would also never trigger sk_data_ready when the association > was closed, making it harder to identify the end of the association > by calling recvmsg() and getting an EOF. It was not convenient for > kernel users. > > The check here should be stopping delivering DATA chunks after receiving > SHUTDOWN, and stopping delivering ANY chunks after sctp_close(). > > So this patch is to allow notifications to enqueue into receive queue > even if sk->sk_shutdown is set to RCV_SHUTDOWN in sctp_ulpq_tail_event, > but if sk->sk_shutdown = RCV_SHUTDOWN | SEND_SHUTDOWN, it drops all > events. > > Signed-off-by: Xin Long Applied.