From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCHv3 net-next] sctp: add support for SCTP_REUSE_PORT sockopt Date: Fri, 29 Jun 2018 22:21:17 +0900 (KST) Message-ID: <20180629.222117.334133330999645450.davem@davemloft.net> References: <710f2cfa644383f8455d9612a80347a28e00d113.1530171060.git.lucien.xin@gmail.com> 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, nhorman@tuxdriver.com To: lucien.xin@gmail.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:45180 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753527AbeF2NVU (ORCPT ); Fri, 29 Jun 2018 09:21:20 -0400 In-Reply-To: <710f2cfa644383f8455d9612a80347a28e00d113.1530171060.git.lucien.xin@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Xin Long Date: Thu, 28 Jun 2018 15:31:00 +0800 > This feature is actually already supported by sk->sk_reuse which can be > set by socket level opt SO_REUSEADDR. But it's not working exactly as > RFC6458 demands in section 8.1.27, like: > > - This option only supports one-to-one style SCTP sockets > - This socket option must not be used after calling bind() > or sctp_bindx(). > > Besides, SCTP_REUSE_PORT sockopt should be provided for user's programs. > Otherwise, the programs with SCTP_REUSE_PORT from other systems will not > work in linux. > > To separate it from the socket level version, this patch adds 'reuse' in > sctp_sock and it works pretty much as sk->sk_reuse, but with some extra > setup limitations that are needed when it is being enabled. > > "It should be noted that the behavior of the socket-level socket option > to reuse ports and/or addresses for SCTP sockets is unspecified", so it > leaves SO_REUSEADDR as is for the compatibility. > > Note that the name SCTP_REUSE_PORT is somewhat confusing, as its > functionality is nearly identical to SO_REUSEADDR, but with some > extra restrictions. Here it uses 'reuse' in sctp_sock instead of > 'reuseport'. As for sk->sk_reuseport support for SCTP, it will be > added in another patch. > > Thanks to Neil to make this clear. > > v1->v2: > - add sctp_sk->reuse to separate it from the socket level version. > v2->v3: > - improve changelog according to Marcelo's suggestion. > > Acked-by: Neil Horman > Signed-off-by: Xin Long Applied, thanks for working on getting the semantics right.