From patchwork Thu Jan 17 19:23:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026927 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="laOHtKpa"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsn2GQzz9sBZ for ; Fri, 18 Jan 2019 06:24:13 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728658AbfAQTYM (ORCPT ); Thu, 17 Jan 2019 14:24:12 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39837 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728577AbfAQTYJ (ORCPT ); Thu, 17 Jan 2019 14:24:09 -0500 Received: by mail-pf1-f196.google.com with SMTP id r136so5296215pfc.6 for ; Thu, 17 Jan 2019 11:24:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=shbTGhYrC6pwkyY+/RnYUM9NoFUPxv8v7ssRuLZIEv0=; b=laOHtKpa1e11ecEpAGKGb0zJPIqWfoXVc2ZS/ziPYnoueW3E50sEze+3NbVCvSNuDG yV9uQnBF27U8twDLFWQJg4oQWcEyPPE3njJAmNqEdq6t5TmTGaEQ1LSTofwirgDIyFlJ XIbY7uCiBn2egvyYb7l5vufjHnPD8DZYOo3N+DCiAe2dUHRG7M+GIVYTFFWe4/40yGhg leAuIuiLl+ncqmap34BKE1gf5TqFD6KhYMnxZCp7YaVLpuCsE91+Spt+zIwKqsvJfyqG mNs9FFx9yCZXfmVzVoDvYUJCJIEt4BKi/+TTt25rMHbhL/xIxltKqqFMkkyPGemXC9nU lpbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=shbTGhYrC6pwkyY+/RnYUM9NoFUPxv8v7ssRuLZIEv0=; b=oVfFGOMrokG8Mju1g85+UZfinCxwEZIxwYhDD3PPsSz5O8VZsIwWmGVU2/Gpjfb6z3 boGAg3j/9kOqF9YqfIhAqdTT90KvTMp8gqA2OUZVRzxlE3a7Uv07F9Lec/9NyjVQU87p g5B/gZ189APOSUTf+FNMtpX6y8GJSRKci/AjpuX23gSQbn0RcPT8oEbGq8sqIwAkltja Z70craX/gsXpTh8sVJBPRpqsncY0bh+kONfa4PqLol6JL+s4EX+WivCJPDecT1wrcOU6 WopN/iP25EfF7XFe7C2XOh1iUSN6koUtntAq3eqmpaAIxFew7sx2EMrljOkwOJR+jsiV utFA== X-Gm-Message-State: AJcUukfrVv6c9z/g+/6oUeqnbSPCn1OjmYnxj/m0ROijnVs7aJkhNhnU pn0NOKhd1zlMGgXliTKRO4PNlQ== X-Google-Smtp-Source: ALg8bN4LEcX9azb3X9yyzK5MtFQXm8Eees5WfcNB1S1BoYxFIxTX4IFKTjGbwghps/y29Ywmc7OsZw== X-Received: by 2002:a63:df50:: with SMTP id h16mr14724948pgj.421.1547753048757; Thu, 17 Jan 2019 11:24:08 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id r1sm3464430pgo.17.2019.01.17.11.24.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:24:07 -0800 (PST) From: Eric Dumazet To: "David S . Miller" Cc: netdev , Soheil Hassas Yeganeh , Neal Cardwell , Yuchung Cheng , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 11/11] tcp: move rx_opt & syn_data_acked init to tcp_disconnect() Date: Thu, 17 Jan 2019 11:23:42 -0800 Message-Id: <20190117192342.71126-12-edumazet@google.com> X-Mailer: git-send-email 2.20.1.321.g9e740568ce-goog In-Reply-To: <20190117192342.71126-1-edumazet@google.com> References: <20190117192342.71126-1-edumazet@google.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If we make sure all listeners have these fields cleared, then a clone will also inherit zero values. Signed-off-by: Eric Dumazet --- net/ipv4/tcp.c | 4 ++++ net/ipv4/tcp_minisocks.c | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 2348199e6cee9b644177b1d5158680359fa2b57d..541bdb9f81d791ca84c7f03d9caf15d84066c32e 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2617,6 +2617,10 @@ int tcp_disconnect(struct sock *sk, int flags) tp->rack.last_delivered = 0; tp->rack.reo_wnd_persist = 0; tp->rack.dsack_seen = 0; + tp->syn_data_acked = 0; + tp->rx_opt.saw_tstamp = 0; + tp->rx_opt.dsack = 0; + tp->rx_opt.num_sacks = 0; /* Clean up fastopen related fields */ diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 27e11eb4164ca18da0e939eb928b5b2442f300dd..182595e2d40ff5b48cd6d095d4bd97b4cb26d3c0 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -489,11 +489,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, tcp_init_xmit_timers(newsk); newtp->write_seq = newtp->pushed_seq = treq->snt_isn + 1; - newtp->rx_opt.saw_tstamp = 0; - - newtp->rx_opt.dsack = 0; - newtp->rx_opt.num_sacks = 0; - if (sock_flag(newsk, SOCK_KEEPOPEN)) inet_csk_reset_keepalive_timer(newsk, keepalive_time_when(newtp)); @@ -534,7 +529,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, tcp_ecn_openreq_child(newtp, req); newtp->fastopen_req = NULL; newtp->fastopen_rsk = NULL; - newtp->syn_data_acked = 0; __TCP_INC_STATS(sock_net(sk), TCP_MIB_PASSIVEOPENS);