Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1646821rdb; Sun, 8 Oct 2023 19:10:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGBxn8jJ360sucnXogh8RSYb7xIp2T8bNraV3E52arC2DjAzlaQfPmmd65OdL7i6EFXfGc0 X-Received: by 2002:a17:90b:4b87:b0:268:f45:c10a with SMTP id lr7-20020a17090b4b8700b002680f45c10amr11634154pjb.26.1696817409624; Sun, 08 Oct 2023 19:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696817409; cv=none; d=google.com; s=arc-20160816; b=rPGy9Q5oSpwYAZhxSUhRYWqqddIRHDqV0Yne892csXDKgdMgxuM9ozGvSeslYXqg9K 4VlAbnb0D0HspeQqzzKRum3Q6PN/fxjBrfIGYwG3Sp2c1Bwas1cMbfIkoREdFEBJx4k6 0QoF9+G/c+W8pvBNpKfRCqSxF4QrQ085y6/oKUMw98BcHr6BlLvyd3zeDNRozCQDDhoL vgZ9kJ/HgcALmHgAyuF9nb9K7Z7jJbYz4NHsgwKhbbCiGN84mW0YOViP4AA1pKGPr3yI ykId5xbRKU1JZK5dEy7YupcnS4kPuGkYDN8R4ZnUcFiu88HaZofUEBijAgKXczspuHNL BSUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=646DFZjZ7sRyG3jU34Av/wjKyxAgPobvRLXxY2TEQw8=; fh=4rJGfl+PNYrcsbGLY+/mfsswC/eAWGv/rUuhSbzvQLM=; b=PKIHcRFdMI95kVtvFvAxqM8A47fbHQjF1pyAs5Mjejfm0wIZh9RkiMNGk8i8/2kGku rYCNJUajv1pflec5K8foPywE/sVaRjVkZXwJV8wRgFIjQyZjj8HLF1Nqu50tiukZYqnc NueWEXzPkyYANdyYpK0tqut/lep8gHvEfZJrIq6+bsVRnKMq5+ibZU18bc1+aYtw9ozf rordtwsN2eCoCS5+lCT3egkVoLwqF/6I+IsaK/jsNGtE74njd8eUxr/a5D32hPbiIc2i KSz2sddM7LAmYwPPdV/Q/UIQjIL1ru4APZLb9kB3E68c4663JnBrVLbkhWSM3rIYTIjI xdlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id qe8-20020a17090b4f8800b002749baa2edesi12090263pjb.24.2023.10.08.19.10.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 19:10:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4D0E8802D143; Sun, 8 Oct 2023 19:10:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344723AbjJICJw (ORCPT + 99 others); Sun, 8 Oct 2023 22:09:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232250AbjJICJv (ORCPT ); Sun, 8 Oct 2023 22:09:51 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CD08A4; Sun, 8 Oct 2023 19:09:49 -0700 (PDT) X-UUID: 28fed6466eed4b1790d911464d79c826-20231009 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:6dfe2cf6-c1da-45e0-bbd1-da03b007062d,IP:-15 ,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-9,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-24 X-CID-INFO: VERSION:1.1.32,REQID:6dfe2cf6-c1da-45e0-bbd1-da03b007062d,IP:-15,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:-9,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-24 X-CID-META: VersionHash:5f78ec9,CLOUDID:636fb8bf-14cc-44ca-b657-2d2783296e72,B ulkID:2310091009398OGIRJL5,BulkQuantity:0,Recheck:0,SF:24|17|19|43|102,TC: nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,O SI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 28fed6466eed4b1790d911464d79c826-20231009 X-User: guodongtai@kylinos.cn Received: from localhost.localdomain [(39.156.73.14)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1526781071; Mon, 09 Oct 2023 10:09:37 +0800 From: George Guo To: fw@strlen.de Cc: davem@davemloft.net, dongtai.guo@linux.dev, dsahern@kernel.org, edumazet@google.com, guodongtai@kylinos.cn, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com Subject: [PATCH v2] tcp: cleanup secure_{tcp, tcpv6}_ts_off Date: Mon, 9 Oct 2023 10:11:08 +0800 Message-Id: <20231009021108.3203928-1-guodongtai@kylinos.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231007105019.GA20662@breakpoint.cc> References: <20231007105019.GA20662@breakpoint.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 08 Oct 2023 19:10:07 -0700 (PDT) X-Spam-Level: ** Correct secure_tcp_ts_off and secure_tcpv6_ts_off call parameter order Signed-off-by: George Guo --- net/ipv4/syncookies.c | 4 ++-- net/ipv4/tcp_ipv4.c | 2 +- net/ipv6/syncookies.c | 4 ++-- net/ipv6/tcp_ipv6.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index dc478a0574cb..537f368a0b66 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c @@ -360,8 +360,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) if (tcp_opt.saw_tstamp && tcp_opt.rcv_tsecr) { tsoff = secure_tcp_ts_off(sock_net(sk), - ip_hdr(skb)->daddr, - ip_hdr(skb)->saddr); + ip_hdr(skb)->saddr, + ip_hdr(skb)->daddr); tcp_opt.rcv_tsecr -= tsoff; } diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index a441740616d7..54717d261693 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -104,7 +104,7 @@ static u32 tcp_v4_init_seq(const struct sk_buff *skb) static u32 tcp_v4_init_ts_off(const struct net *net, const struct sk_buff *skb) { - return secure_tcp_ts_off(net, ip_hdr(skb)->daddr, ip_hdr(skb)->saddr); + return secure_tcp_ts_off(net, ip_hdr(skb)->saddr, ip_hdr(skb)->daddr); } int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp) diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c index 5014aa663452..9af484a4d518 100644 --- a/net/ipv6/syncookies.c +++ b/net/ipv6/syncookies.c @@ -162,8 +162,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) if (tcp_opt.saw_tstamp && tcp_opt.rcv_tsecr) { tsoff = secure_tcpv6_ts_off(sock_net(sk), - ipv6_hdr(skb)->daddr.s6_addr32, - ipv6_hdr(skb)->saddr.s6_addr32); + ipv6_hdr(skb)->saddr.s6_addr32, + ipv6_hdr(skb)->daddr.s6_addr32); tcp_opt.rcv_tsecr -= tsoff; } diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index bfe7d19ff4fd..7e2f924725c6 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -119,8 +119,8 @@ static u32 tcp_v6_init_seq(const struct sk_buff *skb) static u32 tcp_v6_init_ts_off(const struct net *net, const struct sk_buff *skb) { - return secure_tcpv6_ts_off(net, ipv6_hdr(skb)->daddr.s6_addr32, - ipv6_hdr(skb)->saddr.s6_addr32); + return secure_tcpv6_ts_off(net, ipv6_hdr(skb)->saddr.s6_addr32, + ipv6_hdr(skb)->daddr.s6_addr32); } static int tcp_v6_pre_connect(struct sock *sk, struct sockaddr *uaddr, -- 2.34.1