Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 688F9C43387 for ; Thu, 17 Jan 2019 19:24:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3719620859 for ; Thu, 17 Jan 2019 19:24:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="laOHtKpa" 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 Content-Transfer-Encoding: 8bit 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); -- 2.20.1.321.g9e740568ce-goog