Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp24556imm; Thu, 10 May 2018 14:45:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqrjS7s6Pd3g/hyx+RMGn8O4tJgKGEDP3aeX7kfJ+/v80KVCHRJGhqZ3VxfBKC89tAiTv8k X-Received: by 2002:a62:8dc9:: with SMTP id p70-v6mr2900717pfk.72.1525988755211; Thu, 10 May 2018 14:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525988755; cv=none; d=google.com; s=arc-20160816; b=d6vOxTpbLR1qhs3H3QrxK7V0Xg9eOzvRbz2+mOIiXmjiMAMFOyOQohXGTLszdg7Gn3 oPfzZLJwo2uUvROlDf+RdkTN0DEzP/9zz8ZjPnwdaIOcgXOLWBKRJl92Qa4d+/XbIlv2 YM17z35xFERln0HIXmjfD8uf3Ld9E716yP2+iEfG8ODcSzn8Pg3JkjxxbFQLl+ymH9/Q m9+gWl2gQ0HPUQBubRmHBT4XO7SDFeWZiBEjfKKGpGXCCGxahDfG+fZOOdf8NduylQ/J WiA9qDZYHNbk8DqVXF/uuOtz0LzNOI0bP2n7kN+kTDYoB1epL+ivD34Tzn1m9gykPdS1 pUyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=Bi8SFoNzGqiG3ZtQMZ4la18gt8Tu/sRAQxOFxXfpdeY=; b=haOOuZs52bP3RhPFcI0InDw1oq82uNvEAUREMG9ooQ1Yyq8btXRkGsESxn9IG60WsA jezrrbOC4u9TSX/z4VKquEwJOm9+3brAuEGZlfI7XcITPYCLJTh8CNctyG5ThTed5cVM ZCt/+SdfgWO8vXHwCAmGvSR+2TEgdZx+geHmWfzhY5Mmx3WZzi9s4W2Ih/uVOQB466lz sQ+OOSBk6AYEvGiByH5sJBT2GgCsrggmc8K8i5YrragKecQC1H6B8iMm2Ec047fJ+Dmq 1qF0S3KwYRrl7AyajF4rUegFzeqi9OBhsXdSZxy7bNUcA9aPukMqcUCMY7bpaQysX+CJ XPMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 203-v6si1682846pfz.160.2018.05.10.14.45.40; Thu, 10 May 2018 14:45:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752648AbeEJVpX (ORCPT + 99 others); Thu, 10 May 2018 17:45:23 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:37756 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752298AbeEJVpV (ORCPT ); Thu, 10 May 2018 17:45:21 -0400 Received: from localhost (67.110.78.66.ptr.us.xo.net [67.110.78.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 188C1133E8164; Thu, 10 May 2018 14:45:21 -0700 (PDT) Date: Thu, 10 May 2018 17:45:20 -0400 (EDT) Message-Id: <20180510.174520.128087783939744310.davem@davemloft.net> To: jmaxwell37@gmail.com Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jmaxwell@redhat.com Subject: Re: [PATCH net-next v2] tcp: Add mark for TIMEWAIT sockets From: David Miller In-Reply-To: <20180510065351.22535-1-jmaxwell37@gmail.com> References: <20180510065351.22535-1-jmaxwell37@gmail.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 10 May 2018 14:45:21 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jon Maxwell Date: Thu, 10 May 2018 16:53:51 +1000 > This version has some suggestions by Eric Dumazet: > > - Use a local variable for the mark in IPv6 instead of ctl_sk to avoid SMP > races. > - Use the more elegant "IP4_REPLY_MARK(net, skb->mark) ?: sk->sk_mark" > statement. > - Factorize code as sk_fullsock() check is not necessary. > > Aidan McGurn from Openwave Mobility systems reported the following bug: > > "Marked routing is broken on customer deployment. Its effects are large > increase in Uplink retransmissions caused by the client never receiving > the final ACK to their FINACK - this ACK misses the mark and routes out > of the incorrect route." > > Currently marks are added to sk_buffs for replies when the "fwmark_reflect" > sysctl is enabled. But not for TW sockets that had sk->sk_mark set via > setsockopt(SO_MARK..). > > Fix this in IPv4/v6 by adding tw->tw_mark for TIME_WAIT sockets. Copy the the > original sk->sk_mark in __inet_twsk_hashdance() to the new tw->tw_mark location. > Then progate this so that the skb gets sent with the correct mark. Do the same > for resets. Give the "fwmark_reflect" sysctl precedence over sk->sk_mark so that > netfilter rules are still honored. > > Signed-off-by: Jon Maxwell I'm surprised the lack of a mark in timewait sockets wasn't noticed earlier. Applied, thank you.