From patchwork Fri Nov 25 22:29:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 26151 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4325627wrr; Fri, 25 Nov 2022 14:31:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf4EkHBckCd5rZnqtM7aZfMFTgbB66riTr2byLCm49pw+97hXX4K4oZHkzKr06HvV4HyzaPN X-Received: by 2002:a17:902:9686:b0:189:24b3:c54 with SMTP id n6-20020a170902968600b0018924b30c54mr20960832plp.96.1669415497669; Fri, 25 Nov 2022 14:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669415497; cv=none; d=google.com; s=arc-20160816; b=cfakt69vIcZ7RHQ7wMq55X6ObI67pSAMQVP6CL+18jrJWkfjpXjK5uQaprfbxvNwRM WuilJVzoXjeLbHp7hK3WKwb095mCPpmFmFCxk0S/wDMj+qTXhNiFgHsGt6VaCjRVQ/hh yXPD7jpmEu5LLH6idS/ahVbwOAurOzdCcBBEhJBcFQBFkV+WxunzSwSze1LQnQHFP/fs EA69+304Z1d519YvgEuc1SAONI9jPD8XiaHtwNCL6oQxGAtYHIW/xrW1NOvlA8YYdBnC sVFsTyZNFAI5lER7qqAyXEJRG9pdFBKrZyoAl0CS59ce8svh4/e0UP4gtdnut2RkuhaQ o10g== 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 :dkim-signature; bh=smKymeBBa7IBeUrFR8EANYkCpmEzimtdY237ZPCzBos=; b=nrPcZxBItnLfc1u+MNS6NJpaZ4zU5Q0cCn+P9hI66C5Ipbu5MuarXgV8htw/LQmWYt GhTdiKcI4jR++xyWwug7sHexhNnXIKIiXV+17fZNl8TpJsZQE4DAAwwPTEU7nLoh1aJ3 pGqvdvdNyyKoU3FXUGMb8apdFy4qfNvJ5LJndllq1lvtBt5V+ja3OVvbu5wo6l8zWPR+ +e137xjljRb7jW9aRuOB/pC4WsqVOm0c5N21G0bKAqAW+WlsMDQ4uM2OTizucFIw0gpu 9qpfePGZeWSp48z0nFTSBl9eD9pekX+pPJ8rXQKF5rz/60nmVJW8YodwL94q7Zw3GAjn wEhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=cJYbFoQd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bw22-20020a056a00409600b0056c882d3d06si4959642pfb.199.2022.11.25.14.31.24; Fri, 25 Nov 2022 14:31:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=cJYbFoQd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229949AbiKYWai (ORCPT + 99 others); Fri, 25 Nov 2022 17:30:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbiKYWaZ (ORCPT ); Fri, 25 Nov 2022 17:30:25 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DAF02EF3E for ; Fri, 25 Nov 2022 14:30:23 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id i10so13049405ejg.6 for ; Fri, 25 Nov 2022 14:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=smKymeBBa7IBeUrFR8EANYkCpmEzimtdY237ZPCzBos=; b=cJYbFoQdv55knTfHLQrHZieq61wqn0EYtegTu+u1gXSgMnsRcvpqsNGxzeuNmu7BZD pDoXmiXDEIbrjMMLpxGAl7x59J+mNCaBv3Xw7nmOw2cQiTzYCeGJ5QgYNsA6EcS5e2LL SdVMKBZWbRG6T5IfofnhK3dE+7zDTleSdE8oba4kledHZdgkYr5JFT6gVK/xX9FaCNZg gQEvk/IAe1Dvsq3CPPlUJaRxaipenGrMpxS1d2jdINi3UF2IsfITkM2FHlxwf2Ho/kQD Jj+CANmOEQUy+lNKCtXOuRXLfRxrgbD3jv2iEPAbrujN2uLG3y/rj296IjHjJGXNgCbT mRbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=smKymeBBa7IBeUrFR8EANYkCpmEzimtdY237ZPCzBos=; b=1f8Dc0hDF+wJX2z6fMH4lC562SAA5qJKr14yAsjdQrNmfLorU5B8zj1Lqgoipdv85I AmLl2mekpTPSrWyoG5RLMAtQmMJT0ira7O7wHMKEREC7jzNWdFPvRjzJshsMJLs/Q8h0 m+Ki9PQzrBby8jogdGUsHymJKdv3q58SRPKab+pP3zLVYSF0OAo/CdmZCZZ+BZjsGqMm Bb4fxL6WHyog/fcHW8ytzocoobkgXGDy8uRc1nuCff23MTEJNTfOLMPtU3EfqkIMl6jX AN5EbVxUQd/RJjMvQDe9c8TmmdW+HuyhPFFzwB5iVNqhMeD8iNYcVwBEzPDgVA9P0H/u HdpA== X-Gm-Message-State: ANoB5pmexHH7u1klLDAW8maa/cpRzDdgH7Paz1/tzmI/FPByWOl4igLw 9qWWGZJ/vBom8TQ0/bY05GxSKA== X-Received: by 2002:a17:906:660e:b0:78d:b43c:81be with SMTP id b14-20020a170906660e00b0078db43c81bemr24506505ejp.600.1669415421794; Fri, 25 Nov 2022 14:30:21 -0800 (PST) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id q1-20020a056402248100b0046267f8150csm2254612eda.19.2022.11.25.14.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 14:30:21 -0800 (PST) From: Matthieu Baerts To: Mat Martineau , Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/8] mptcp: track accurately the incoming MPC suboption type Date: Fri, 25 Nov 2022 23:29:48 +0100 Message-Id: <20221125222958.958636-3-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221125222958.958636-1-matthieu.baerts@tessares.net> References: <20221125222958.958636-1-matthieu.baerts@tessares.net> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1843; i=matthieu.baerts@tessares.net; h=from:subject; bh=J6Pasy5rywxbTiBcJF5r2K+UumRyCmzkUNlg31Z58ec=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBjgUHP5Alj7g+lojdWNJTyMzRKAHbHZihRsnaAGFAQ ghjyeE+JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCY4FBzwAKCRD2t4JPQmmgc/RqD/ oDcgBqCUCwGoAi1hXNdqvmfSR1QREb7BGwoVgLgzzTivGWiXmi1+0R0+OE+dQjTpVDm3OTlOK+vTpt xzGX/63VwCA2HPMrVzgn9KfmcLVUnKk7ArkHgJ23f4K0t53YL7VVtiA+G8r00uFkYKabZ9XrWt7z0q sdsGgGwPU45fE9/GSUJ0eBtiXKRe1ergC2S1wiJvJdsuuYApCrbdoKGUqGDmPOOUpHBypcOmM4cuX3 9tsew1nFvKMOH+fj/O+S3N5P6NMT5n7CZ9r/h1KAdGkDsQAMwkhh7bsiLE7OBV+ADuRCWDWUHKVZzp tHWw5+615hOM+qLWxX0IWeLGIZFzS3hQxOeldTTOX02395rhdMUOCexUZ/hPAfEmpLeBBjjPE3X3ZV YbwL5tV7ahrthy7uaC/s76Qxamk7Ra2+KTChdzOtZLDkchjxHzxj3Z7Nui6yO/B9w8tEYmJ/WbyFA0 633oN/YdeLYiiv9jZGCt2E4HKW0a5YY8JppUbi7fdn2K4yYs1XMS9yfqCOU3zMIGzVbpHow6AXx++w kAdsWXv5ZqMC70+uF2+mElkZo2dB1jKewhCDMO6V35cCXFGbQr0P7W7zPwZAXAH+MTIgJKnlrnbHg4 r/CW+lNDCicVF4ioYlF3EoVteIXT3ieon9AIsNcPIKn1QDZUlyV1Iiqa8qPw== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750509024760794654?= X-GMAIL-MSGID: =?utf-8?q?1750509024760794654?= From: Paolo Abeni Currently in the receive path we don't need to discriminate between MPC SYN, MPC SYN-ACK and MPC ACK, but soon the fastopen code will need that info to properly track the fully established status. Track the exact MPC suboption type into the receive opt bitmap. No functional change intended. Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts --- net/mptcp/options.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 30d289044e71..784a205e80da 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -26,6 +26,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, { u8 subtype = *ptr >> 4; int expected_opsize; + u16 subopt; u8 version; u8 flags; u8 i; @@ -38,11 +39,15 @@ static void mptcp_parse_option(const struct sk_buff *skb, expected_opsize = TCPOLEN_MPTCP_MPC_ACK_DATA; else expected_opsize = TCPOLEN_MPTCP_MPC_ACK; + subopt = OPTION_MPTCP_MPC_ACK; } else { - if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_ACK) + if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_ACK) { expected_opsize = TCPOLEN_MPTCP_MPC_SYNACK; - else + subopt = OPTION_MPTCP_MPC_SYNACK; + } else { expected_opsize = TCPOLEN_MPTCP_MPC_SYN; + subopt = OPTION_MPTCP_MPC_SYN; + } } /* Cfr RFC 8684 Section 3.3.0: @@ -85,7 +90,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, mp_opt->deny_join_id0 = !!(flags & MPTCP_CAP_DENY_JOIN_ID0); - mp_opt->suboptions |= OPTIONS_MPTCP_MPC; + mp_opt->suboptions |= subopt; if (opsize >= TCPOLEN_MPTCP_MPC_SYNACK) { mp_opt->sndr_key = get_unaligned_be64(ptr); ptr += 8;