From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrei Vagin Subject: Re: [PATCH] net: split sk_reuse into sk_reuse and sk_force_reuse Date: Thu, 14 Jun 2018 13:02:29 -0700 Message-ID: <20180614200224.GA20731@outlook.office365.com> References: <20180614005606.1057-1-avagin@openvz.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Andrey Vagin , David Miller , netdev , Maciej =?utf-8?Q?=C5=BBenczykowski?= To: Eric Dumazet Return-path: Received: from mail-eopbgr10124.outbound.protection.outlook.com ([40.107.1.124]:64191 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755392AbeFNUCr (ORCPT ); Thu, 14 Jun 2018 16:02:47 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Jun 13, 2018 at 06:17:41PM -0700, Eric Dumazet wrote: > On Wed, Jun 13, 2018 at 5:56 PM Andrei Vagin wrote: > > > The commit f396922d862a added a check to not allow changing > > SO_REUSEADDR/SO_REUSEPORT on bound sockets. First, it doesn't > > take into account that TCP_REPAIR changes SO_REUSEADDR. Second, now it > > is impossible to restore a socket state and set SO_REUSEADDR, > > because the kernel always sets SO_REUSEADDR into zero after disabling > > the repair mode. > > > > > Hi Andrey > > This commit was reverted, do we still need this patch ? I have seen that this patch was reverted. Probably I had to check net-next before sending it. I'm agree with Maciej Żenczykowski that it makes this code better. I have never understood why TCP_REPAIR drops SO_REUSEADDR. Now each time when we use TCP_REPAIR, we have to save a value of SO_REUSEADDR and restore it back after disabling TCP_REPAIR. With this patch, we will able to enable/disable TCP_REPAIR and don't care about sk_reuse. I will update the commit message and send the patch again. Thanks, Andrei