From nobody Sat Apr 20 14:33:11 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6638:38c:0:0:0:0 with SMTP id y12csp6363271jap; Thu, 30 Dec 2021 11:17:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhNJhYWqx/nCwN64NIftacIAupxgpQeXf2galyL4JZVb5XE2qA6zehdNYiCbS5qG24zydI X-Received: by 2002:a05:622a:15c3:: with SMTP id d3mr28109986qty.194.1640891866460; Thu, 30 Dec 2021 11:17:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640891866; cv=none; d=google.com; s=arc-20160816; b=K//CFzJv9aIjpy97sAKl4sb01ggtO/0NqgOOblf9Ked1QrzSDdcOUwmCgs1q3O/xeG HQgQAIuPMXp5+WE9iiYMF8y9JOob/vkt2AQVPYJe9XMM+CymJTa4JzQQrsv1oa/l8gBM tPzD4UQu3lK2MRS0GytPbQ6CcCaZN5/9NGqRQg+ci3KGZQGde+hGyY80L8nwJ/J1JJAn GaBP3w+wZcNd0r8zXhb31n29y+A25UHH9O8OJv5nIZVMo17zc3hw+RZM8tYjv/eOUeAP fp82+KmWiwgecNG5GNZNN6fC2RDXGQJUK/JJkPrJX721rancPpKNuL0gVcgsAP/PEVxU MnOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=coY5IWE8WsTmu8wB43g2Fb20MGtXGQRTSRhx9pY0gGI=; b=MDrQrbv6pe6AMgpGqsmSRxcBpa4bOmelqNoBGbbpbL+HszNLSFRe22YnpaHlx8ti/I qi2ygY7gzzD7VIGM65Gtf+PxucifhWBwE/hoEI4untQ+mD8Ph8BlNB2crHZBUaUfoY80 0z1dhE61yQjk5065+++PgbE5vIyLH2EXV530QpX1oiQlKJuwewSuLwHyewWVTmmnmWRp 1rfay/VXKR3O50LSX889lhWeRYDRqzikGEyQSYZUed2WQh2X9i3vq+cY83VYnvc01sLa amcfle5ScV5bLnvma2s2pRiClyoCrMmbXgnq6nSIYzFsia9A7IfKRmzT3k3GbGm6HP3w 8idw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=XLMBtY2x; spf=pass (google.com: domain of mptcp+bounces-2874-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2874-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from ewr.edge.kernel.org (ewr.edge.kernel.org. [2604:1380:1:3600::1]) by mx.google.com with ESMTPS id bq32si10672121qkb.290.2021.12.30.11.17.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Dec 2021 11:17:46 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2874-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) client-ip=2604:1380:1:3600::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=XLMBtY2x; spf=pass (google.com: domain of mptcp+bounces-2874-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2874-wpasupplicant.patchew=gmail.com@lists.linux.dev" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ewr.edge.kernel.org (Postfix) with ESMTPS id 2FFED1C08CB for ; Thu, 30 Dec 2021 19:17:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03C532CA1; Thu, 30 Dec 2021 19:17:45 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 446992C80 for ; Thu, 30 Dec 2021 19:17:43 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id j6so101336357edw.12 for ; Thu, 30 Dec 2021 11:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares-net.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=coY5IWE8WsTmu8wB43g2Fb20MGtXGQRTSRhx9pY0gGI=; b=XLMBtY2xp2TziK+S4vk6NyzDOiY94RpqxwpKqTBbYkZWy+LNoOoL0eLIaMItzumPnO x879NBGR7+aaLb62Ilt9dcgfUbLRSGTqLp1+l+MQJNVUYFlGhG6gktseJVfYyQ0B239L Z+AqcHtfxoY4UztGaXPVauxNn8/GilbM/wY23jylx9XovPq01Xiwvwh/yEgKXNc9Q1Vm 5rNm9DaK0qzw3O2yOoLjoro5FsknsOId+gj2LlQiMYhZKT9SvUha2CAyQtU/Cjnp5DlC Jjth0mreRPyd1TJYkBR8se9uHd9hHVZojWbhOOeVWa3DdR1qNtWSlnKd4vZT59p4XJVQ Szrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=coY5IWE8WsTmu8wB43g2Fb20MGtXGQRTSRhx9pY0gGI=; b=Tcv84Q+buVE9PL2T57gsWAi8oWSd4i+QDGThXNjaOaK9W1GfUD/vwTPBGJd0riVFw4 HhzIW+sziQamdroxhfsSc6mlXR0gCbeKX++sWwcxyqw8WID3IWZ5CUHvntHxc4EVsaI6 HnI/5Ri+0OYQYDPmta/sG3k00mnmFHHhKBWRo5wi23RfrPuEco3QvKO0a81T5QEUP/iq uORL//Hd2LPaWul3xA7VQdODbggjKs7kLAjjp4RPg/XKxCymmErhRihtX5IiBiLHfDTy 4Gc2RWp0vHw2WIiZlUrqQm5WaPcP23PFUWMdK4BFeBziuMi4/XLgvBWucU91e7sYw+Zs pGDA== X-Gm-Message-State: AOAM532Av/mwWB5EsA6vs2ySRdDwYGEMy2XZWGV3nD2P7o60M/0xhrrp t8nSpoWDpdsv3aWtlJqft4kL+PLqLdVazw2P X-Received: by 2002:a17:906:5d01:: with SMTP id g1mr25947538ejt.219.1640891861088; Thu, 30 Dec 2021 11:17:41 -0800 (PST) Received: from tsr-vdi-mbaerts.nix.tessares.net (static.23.216.130.94.clients.your-server.de. [94.130.216.23]) by smtp.gmail.com with ESMTPSA id m6sm9918244edc.36.2021.12.30.11.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Dec 2021 11:17:40 -0800 (PST) From: Matthieu Baerts To: mptcp@lists.linux.dev Cc: Geliang Tang , Paolo Abeni , Matthieu Baerts Subject: [PATCH mptcp-next v7 1/4] Squash to "mptcp: implement fastclose xmit path" Date: Thu, 30 Dec 2021 20:16:48 +0100 Message-Id: <20211230191651.1831507-2-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211230191651.1831507-1-matthieu.baerts@tessares.net> References: <20211230191651.1831507-1-matthieu.baerts@tessares.net> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang MP_FAIL could be sent with RST or DSS, and FASTCLOSE can be sent with RST too. So we should use a similar xmit logic for FASTCLOSE and MP_FAIL in both mptcp_write_options() and mptcp_established_options*(). Cc: Paolo Abeni Co-developed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Geliang Tang --- net/mptcp/options.c | 66 ++++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index c6726e8389ec..9d2c1c9edbe6 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -829,8 +829,12 @@ bool mptcp_established_options(struct sock *sk, struct= sk_buff *skb, =20 if (unlikely(skb && TCP_SKB_CB(skb)->tcp_flags & TCPHDR_RST)) { if (mptcp_established_options_fastclose(sk, &opt_size, remaining, opts) = || - mptcp_established_options_mp_fail(sk, &opt_size, remaining, opts) || - mptcp_established_options_rst(sk, skb, &opt_size, remaining, opts)) { + mptcp_established_options_mp_fail(sk, &opt_size, remaining, opts)) { + *size +=3D opt_size; + remaining -=3D opt_size; + } + /* MP_RST can be used with MP_FASTCLOSE and MP_FAIL if there is room */ + if (mptcp_established_options_rst(sk, skb, &opt_size, remaining, opts)) { *size +=3D opt_size; remaining -=3D opt_size; } @@ -1257,21 +1261,7 @@ static u16 mptcp_make_csum(const struct mptcp_ext *m= pext) void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp, struct mptcp_out_options *opts) { - if (unlikely(OPTION_MPTCP_FAIL & opts->suboptions)) { - const struct sock *ssk =3D (const struct sock *)tp; - struct mptcp_subflow_context *subflow; - - subflow =3D mptcp_subflow_ctx(ssk); - subflow->send_mp_fail =3D 0; - - *ptr++ =3D mptcp_option(MPTCPOPT_MP_FAIL, - TCPOLEN_MPTCP_FAIL, - 0, 0); - put_unaligned_be64(opts->fail_seq, ptr); - ptr +=3D 2; - } - - /* DSS, MPC, MPJ, ADD_ADDR, FASTCLOSE and RST are mutually exclusive, + /* DSS, MPC, MPJ, ADD_ADDR, FASTCLOSE and FAIL are mutually exclusive, * see mptcp_established_options*() */ if (likely(OPTION_MPTCP_DSS & opts->suboptions)) { @@ -1328,6 +1318,10 @@ void mptcp_write_options(__be32 *ptr, const struct t= cp_sock *tp, TCPOPT_NOP << 8 | TCPOPT_NOP, ptr); } } + + /* We might need to add MP_FAIL options in rare cases */ + if (unlikely(OPTION_MPTCP_FAIL & opts->suboptions)) + goto mp_fail; } else if (OPTIONS_MPTCP_MPC & opts->suboptions) { u8 len, flag =3D MPTCP_CAP_HMAC_SHA256; =20 @@ -1460,19 +1454,41 @@ void mptcp_write_options(__be32 *ptr, const struct = tcp_sock *tp, ptr +=3D 1; } } - } else if (unlikely(OPTION_MPTCP_RST & opts->suboptions)) { - /* RST is mutually exclusive with everything else */ - *ptr++ =3D mptcp_option(MPTCPOPT_RST, - TCPOLEN_MPTCP_RST, - opts->reset_transient, - opts->reset_reason); - return; } else if (unlikely(OPTION_MPTCP_FASTCLOSE & opts->suboptions)) { - /* FASTCLOSE is mutually exclusive with everything else */ + /* FASTCLOSE is mutually exclusive with others except RST */ *ptr++ =3D mptcp_option(MPTCPOPT_MP_FASTCLOSE, TCPOLEN_MPTCP_FASTCLOSE, 0, 0); put_unaligned_be64(opts->rcvr_key, ptr); + + if (OPTION_MPTCP_RST & opts->suboptions) + goto mp_rst; + return; + } else if (unlikely(OPTION_MPTCP_FAIL & opts->suboptions)) +mp_fail: + { + /* MP_FAIL is mutually exclusive with others except RST */ + const struct sock *ssk =3D (const struct sock *)tp; + struct mptcp_subflow_context *subflow; + + subflow =3D mptcp_subflow_ctx(ssk); + subflow->send_mp_fail =3D 0; + + *ptr++ =3D mptcp_option(MPTCPOPT_MP_FAIL, + TCPOLEN_MPTCP_FAIL, + 0, 0); + put_unaligned_be64(opts->fail_seq, ptr); + ptr +=3D 2; + + if (OPTION_MPTCP_RST & opts->suboptions) + goto mp_rst; + return; + } else if (unlikely(OPTION_MPTCP_RST & opts->suboptions)) { +mp_rst: + *ptr++ =3D mptcp_option(MPTCPOPT_RST, + TCPOLEN_MPTCP_RST, + opts->reset_transient, + opts->reset_reason); return; } =20 --=20 2.33.1 From nobody Sat Apr 20 14:33:11 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6638:38c:0:0:0:0 with SMTP id y12csp6363337jap; Thu, 30 Dec 2021 11:17:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmb4dBSpqasyFwo6Pql0Or0XzG/0oldZtCMMC/2Sq9qY+48EfaxgBEFXNq4PhJK5INoMxn X-Received: by 2002:a17:903:244f:b0:149:873:e17c with SMTP id l15-20020a170903244f00b001490873e17cmr31992858pls.133.1640891870699; Thu, 30 Dec 2021 11:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640891870; cv=none; d=google.com; s=arc-20160816; b=D1JelRc4+FxyG+/44asNrtIrPVPTOzEWkPzr/ptOz0N5Ik1IYupJCdmD6tpaT2oWWZ 4ptSDxL77wa4FJa9AuYy89Fcnpt/ralWU0tijwln39etSH1fyA/1sxz6D0pFbwE2Xl+H kprkNV1csd5B7tylYSf9MYrjqaM5nJTK31X1kBJSP6pmw3vrkTMzX5gruAlkQl8SCV/P JRMGC7f2Ed0RZ8pK1v/HqTOLMag48y8eTIIk2sqiyEA5wTI+2KSVuZo+PwrBOPyCNi/e Purp11NsAKBC9an9ORKVVPXQVtGypPRsScChfvzpqD6sVZ8gPQ/WLnMPh/n374OeStnT 2m1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ugdlGyoxxcEr3RwXgTx3Zvpw14Hz/Qm+DG89uJqxLIo=; b=bSoL2yYQQe+cn/BiW77x2Tk9/S2V3MZXEpkgOcBuoB5L/KzIJmBxf4vrEE6FOfnUvs +X7EZAMpjyzQJXG3UGMyVCjgXw52WqZvGbOJRlB/PUFTb+qdHO3+UTNfEDM4T9QDl4Ig PUuOjjkYjgc+C6+CDlnh+hhhkkdAzrToVsxSxWrYILud59NomFjR0+J1aiYVEy9gNZiY q/ZNouJgRJ1vAdZGsx0gJhst9X4eRVksQOlaDYGJobGR5HtmaMl38XmgV6Ip8jverf7e 73Nysn8oEnNazwQuBk2ZbbmC9/YfxAcA0//GKAwOX8GZxnctbReuxEayf+aUaOA3HVCT AByg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=eZn1UZI8; spf=pass (google.com: domain of mptcp+bounces-2875-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-2875-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [147.75.69.165]) by mx.google.com with ESMTPS id c197si23109630pfc.14.2021.12.30.11.17.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Dec 2021 11:17:50 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2875-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) client-ip=147.75.69.165; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=eZn1UZI8; spf=pass (google.com: domain of mptcp+bounces-2875-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-2875-wpasupplicant.patchew=gmail.com@lists.linux.dev" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sjc.edge.kernel.org (Postfix) with ESMTPS id E4BD33E0E4C for ; Thu, 30 Dec 2021 19:17:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB4C62CA1; Thu, 30 Dec 2021 19:17:48 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CA032C80 for ; Thu, 30 Dec 2021 19:17:47 +0000 (UTC) Received: by mail-ed1-f48.google.com with SMTP id m21so102706992edc.0 for ; Thu, 30 Dec 2021 11:17:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares-net.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ugdlGyoxxcEr3RwXgTx3Zvpw14Hz/Qm+DG89uJqxLIo=; b=eZn1UZI8o1b6/hQFtUBiMCT8z9hg5qF65QLk261qNxiVOfOSvdEhqRNwGQ19RbpIPp EhsN9HpduDHEd0BBS8nHnV3YgCZ2vkTbP4Huev7JakWeKDGBx7/7Kv2i82LzWQOt79F3 FAQ4ZvMbpKyS2Pr9inG1mapuFVeMPFpiwoQsBn/VZhvpYuS0uEgs6IdjZE21VrvY9GFt +mItoNBKEL275FpQ3CTqNI+wrwBEFkXUZY2q5HKRERRX1wRGiVr8DVZvARbAgR3ho2/1 i5ifW2SpJqLliCdOiDM+ylCthvemxOrseUyVIhuiLK02+P31ksftlIXgIc3D2yKoR4Ws RB+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ugdlGyoxxcEr3RwXgTx3Zvpw14Hz/Qm+DG89uJqxLIo=; b=A99ygGVB+KztLRgHFeBPOZui12L4bDl08S5dTjAjB30YIXSQU+9XDWoblTvDRZr0oc 332v/B/ILWfmKQm6GBbdokGF8aAZ4PD3VIqWyH7J1IIKeTClOvlXzkYJGjY+pyCm+KVC 5u4QN0JdKUG6Jvmgz7Adcx4KVG7Zo++8xjIxaPUcsMxtCyezvnANeFR7APB0LELiuDJz IXnTkojsUGLxETpF/PRFUTH7AzDqVmGTzJ+utOABGQZYH8RWkMa8lW+J/B2Y5paiWTAA BK0F/cW7HKhhTr3pwhFq0hlj/XGgmWO3Iw2VW5qCtR03VwUBhPWK0LEpU/Zei835Kem1 Ehjg== X-Gm-Message-State: AOAM531mDHNj0Qyr0i14jcTD1mcdtwp7GvKtH9U6qMdKoNxov+iGqaLD EFMEPbXVZwZydkqSb2ZnbjQKTlBESikdOINQ X-Received: by 2002:a17:907:7282:: with SMTP id dt2mr25592372ejc.653.1640891865639; Thu, 30 Dec 2021 11:17:45 -0800 (PST) Received: from tsr-vdi-mbaerts.nix.tessares.net (static.23.216.130.94.clients.your-server.de. [94.130.216.23]) by smtp.gmail.com with ESMTPSA id m6sm9918244edc.36.2021.12.30.11.17.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Dec 2021 11:17:45 -0800 (PST) From: Matthieu Baerts To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v7 2/4] mptcp: print out reset infos of MP_RST Date: Thu, 30 Dec 2021 20:16:49 +0100 Message-Id: <20211230191651.1831507-3-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211230191651.1831507-1-matthieu.baerts@tessares.net> References: <20211230191651.1831507-1-matthieu.baerts@tessares.net> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang This patch printed out the reset infos, reset_transient and reset_reason, of MP_RST in mptcp_parse_option() to show that MP_RST is received. Signed-off-by: Geliang Tang --- net/mptcp/options.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 9d2c1c9edbe6..3427b31c0da7 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -336,6 +336,8 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, flags =3D *ptr++; mp_opt->reset_transient =3D flags & MPTCP_RST_TRANSIENT; mp_opt->reset_reason =3D *ptr; + pr_debug("MP_RST: transient=3D%u reason=3D%u", + mp_opt->reset_transient, mp_opt->reset_reason); break; =20 case MPTCPOPT_MP_FAIL: --=20 2.33.1 From nobody Sat Apr 20 14:33:11 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6638:38c:0:0:0:0 with SMTP id y12csp6363416jap; Thu, 30 Dec 2021 11:17:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtW9KjkEuGUtqFM97EAdS/tGKn3iSNNKC8cgetOZmjc1OZYx6EIjvrLFH1n7hOX2stxn/4 X-Received: by 2002:ac8:7f56:: with SMTP id g22mr24314844qtk.234.1640891876270; Thu, 30 Dec 2021 11:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640891876; cv=none; d=google.com; s=arc-20160816; b=TnziuzmVR4wV5DawWKl/Lr2inokQ95COMZWP/Eapj1JHtspy+JdF7oufhCBVTdgwsc g1FY+ZnE5lOBiFw06cDYQtnfk0ShiRAi690D2tKGwnZ+Aw2uwN8oXjCnfU1B4PJT21FA UXy1NDnfRHeZ04JFiMI2CYZNzsqFBwe8XT9xtw0j/H0EsQeSJ3mriKvuHeW0isPJgXqO FlLF5nYJaqrjFkIjevTtbU19TfoOpES80xcYnVwkzck4Xv06e57OyiyCLSPapBzBadYj 4hcqP1DvizMo3VPI4sJCGb0h8ZZHRvnuRlv6AIuMxg544SYKXsxya09ngRcghyTmDa2u LBRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ISRM4adwNoqkzh7B445fjcCrFszOmyg8baD6T4jy2dA=; b=IYfN9uksHA2cIDeEn+LkFVdgTPa4m4buDse+aQ7l91e51h99SoQarLNHzAQfBCKMDc I9iEHLwuUl2hE3WX4Jq+rZt6lzM8WaWQaKyEv794l8sGTa3rvf8SVhig1sPiE/RCU/rI YyxKOHO+OgdEMTdNaPdMpQT7tXjXBze06qZ/8SOZCrXYoM2OB35V5z2FHN/2vVC83E3p B62uGkLAF69kyzb0y0zvwBiipkI5kRSApUr/R6H/ZO8rflWLXdx6Zry3nDypaEBLS1Np r8TxnI6I9lnhAk4bSX7YhqbXUO8IGsrJzDlXUFZvlHb6+Uvi1AocIZCacRKd3zJ4pY+x sulQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=1aKO9SiF; spf=pass (google.com: domain of mptcp+bounces-2876-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2876-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from ewr.edge.kernel.org (ewr.edge.kernel.org. [2604:1380:1:3600::1]) by mx.google.com with ESMTPS id fq5si10867018qvb.18.2021.12.30.11.17.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Dec 2021 11:17:56 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2876-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) client-ip=2604:1380:1:3600::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=1aKO9SiF; spf=pass (google.com: domain of mptcp+bounces-2876-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2876-wpasupplicant.patchew=gmail.com@lists.linux.dev" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ewr.edge.kernel.org (Postfix) with ESMTPS id 01DDB1C0782 for ; Thu, 30 Dec 2021 19:17:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCA712CA1; Thu, 30 Dec 2021 19:17:54 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A8752C80 for ; Thu, 30 Dec 2021 19:17:53 +0000 (UTC) Received: by mail-ed1-f49.google.com with SMTP id w16so101506453edc.11 for ; Thu, 30 Dec 2021 11:17:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares-net.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ISRM4adwNoqkzh7B445fjcCrFszOmyg8baD6T4jy2dA=; b=1aKO9SiF5D3KwrxH6wUQCO1yd6iXx41+RmVixn/2b9aUW7tSC6EcSmwH266DnWp0ka qWzA9CatQFKzbNIoi7i9S52koOmoJO1853R8qYc9f/MqJZkoo4VZfZpWjazGe5sXNsq4 +yv6WPnfHn1Gj9idMQBy5UmWZRrRq4ymcoHgbAdfvO6DwqE8hOdjP1dg1Hbx+IaJ97NH 9P7Jag2kk9z0cDq4Jzs16x1kLzH9wV770ltuZplDxygD+sLhF0GTI/ec/oMLPxKWztHR 6pErJXZ7QR9bB5UiXvrLL3v3rfvHUeN3dov6COt5VtO+BKG42ausgmvr4DJQyIGzWOHc qHFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ISRM4adwNoqkzh7B445fjcCrFszOmyg8baD6T4jy2dA=; b=FvzlYBAnU/hLkkvAc4iQV15Ur1OTuHR7SwelHSgKP1KRsAggykdVyJw75Tuy5EdsXR xOSCYcqLnzJTw1oHuR3dw7fMQtdTBZQLMcnZpzaS4VA0bnkUS7qUqEsTYjN4Sno6/P4S zOjGyZZmgBKS/K7gv8ckRtbBkcwpNyGyIsm8j67zjSlhmI1wDm4Dd/rjBV8Av35XyHtK 4MxY9akHM49vfYBpXyVczAanelVXuJIJJlTvek25HlxMLurgI+iNxl+DzVODlbdABv+Y 9jQqWiCRUoj7OEERmsBysN3zoWfAQ2oDCgtCjXfRZWi8/wLp6kIaZ7GGjbVCOOdSfOYi IYuQ== X-Gm-Message-State: AOAM533V81Qu1dYqqsJa2iREN3MO9fSQZw/NaSWTo062winJaWCv8VeE R0ELYNlpj0++0TGm2ogLoMRv7Faoy29zjatU X-Received: by 2002:a17:906:390c:: with SMTP id f12mr26171042eje.95.1640891871468; Thu, 30 Dec 2021 11:17:51 -0800 (PST) Received: from tsr-vdi-mbaerts.nix.tessares.net (static.23.216.130.94.clients.your-server.de. [94.130.216.23]) by smtp.gmail.com with ESMTPSA id m6sm9918244edc.36.2021.12.30.11.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Dec 2021 11:17:51 -0800 (PST) From: Matthieu Baerts To: mptcp@lists.linux.dev Cc: Matthieu Baerts Subject: [PATCH mptcp-next v7 3/4] mptcp: clarify when options can be used Date: Thu, 30 Dec 2021 20:16:50 +0100 Message-Id: <20211230191651.1831507-4-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211230191651.1831507-1-matthieu.baerts@tessares.net> References: <20211230191651.1831507-1-matthieu.baerts@tessares.net> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" RFC8684 doesn't seem to clearly specify which MPTCP options can be used together. Some options are mutually exclusive -- e.g. MP_CAPABLE and MP_JOIN --, some can be used together -- e.g. DSS + MP_PRIO --, some can but we prefer not to -- e.g. DSS + ADD_ADDR -- and some have to be used together at some points -- e.g. MP_FAIL and DSS. We need to clarify this as a base before allowing other modifications. For example, does it make sense to send a RM_ADDR with an MPC or MPJ? This remains open for possible future discussions. Signed-off-by: Matthieu Baerts --- net/mptcp/options.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 3427b31c0da7..d06855e66007 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -1263,8 +1263,27 @@ static u16 mptcp_make_csum(const struct mptcp_ext *m= pext) void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp, struct mptcp_out_options *opts) { - /* DSS, MPC, MPJ, ADD_ADDR, FASTCLOSE and FAIL are mutually exclusive, - * see mptcp_established_options*() + /* Which options can be used together? + * + * X: mutually exclusive + * O: often used together + * C: can be used together in some cases + * P: could be used together but we prefer not to (optimisations) + * + * Opt: | MPC | MPJ | DSS | ADD | RM | PRIO | FAIL | FC | + * ------|------|------|------|------|------|------|------|------| + * MPC |------|------|------|------|------|------|------|------| + * MPJ | X |------|------|------|------|------|------|------| + * DSS | X | X |------|------|------|------|------|------| + * ADD | X | X | P |------|------|------|------|------| + * RM | C | C | C | C |------|------|------|------| + * PRIO | X | C | C | C | C |------|------|------| + * FAIL | X | X | C | X | X | X |------|------| + * FC | X | X | X | X | X | X | X |------| + * RST | X | X | X | X | X | X | O | O | + * ------|------|------|------|------|------|------|------|------| + * + * The same applies in mptcp_established_options() function. */ if (likely(OPTION_MPTCP_DSS & opts->suboptions)) { struct mptcp_ext *mpext =3D &opts->ext_copy; --=20 2.33.1 From nobody Sat Apr 20 14:33:11 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6638:38c:0:0:0:0 with SMTP id y12csp6363515jap; Thu, 30 Dec 2021 11:18:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMVWBV8oRP2ItljtGJoO2/Dgj8ob+QDOKB3cbk5L6ES9m1V5LixEIsedQwlGi7z/rt0VRR X-Received: by 2002:a05:6808:2207:: with SMTP id bd7mr21679022oib.12.1640891883875; Thu, 30 Dec 2021 11:18:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640891883; cv=none; d=google.com; s=arc-20160816; b=MGny5XS7x3QwhqwVr12dP3HexL4z8JkktiZdogdmxZCARTXnsC+F9XHGRJOiDsY2Fy 5fdbxgWfJ/LqPWkyxRf3vh7qy41y/B7ABsfJUWFsDcMw6Ve+sEu36rXtpDboAuk9OCTu kdj6D02+hK2tpmiRaF6jUn/fy96xC2haPyXGGdfpM79AePJkZretOUZYlJpVCsmFtoqO V13VJV4Ohw7vewfQm8qVd7JK6tVRBt3u78HZ8FQ5aetpDJokikRZzZ8smNYrX1jyYOML 657QZGMbsLCfTLvI/cQd8Lt6dkAs9S1+n3VvhjiHkIZHfzWeRRrtA9S0jwu96D1QUnBA Dh2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=yN3NI4558XnAgcWdeQRXOWViZ0Qc4qBX0GV2hSfqTVk=; b=EEnuKe1yXHNyq9YDVwWjqnRo4CvfthBbE/mu6RqEu21kVxI9EblT3alAnA++9bi9rM u9JO1aYL2K3kywqJOGVqiZ2qg3GoOZZi7T1y2zXGfHXh0+sKwM3RnkI1HEkR2o/hcytB Veh/M4m7Ec0pj+/8+/WGkzHA4MjjW95WDdlaLVFR3GEWgnyBF17ZA5YY/+k5UKzyJbhw 9Z/7QTKUD1S0e8yLli4vhTV7/i4G9R7KAWUeMKg9DLrKjqKfI0VpugOm/eCHwJopT7nt NDxslf/fmBBFyCZnJLJDTd3A8lIGtfOd+iW9bZjhZGaBU9chSckat4v/a2k4sy2TjtOf Qv7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=OAEMIXEN; spf=pass (google.com: domain of mptcp+bounces-2877-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2877-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [2604:1380:1000:8100::1]) by mx.google.com with ESMTPS id v19si14741639oto.30.2021.12.30.11.18.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Dec 2021 11:18:03 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2877-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) client-ip=2604:1380:1000:8100::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=OAEMIXEN; spf=pass (google.com: domain of mptcp+bounces-2877-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2877-wpasupplicant.patchew=gmail.com@lists.linux.dev" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sjc.edge.kernel.org (Postfix) with ESMTPS id D63833E0E69 for ; Thu, 30 Dec 2021 19:18:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C01182CA1; Thu, 30 Dec 2021 19:18:01 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 641B02C80 for ; Thu, 30 Dec 2021 19:18:00 +0000 (UTC) Received: by mail-ed1-f45.google.com with SMTP id z9so31571091edm.10 for ; Thu, 30 Dec 2021 11:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares-net.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yN3NI4558XnAgcWdeQRXOWViZ0Qc4qBX0GV2hSfqTVk=; b=OAEMIXENSXzlqQC5H+Ye1QJhJN2jaDu5vkAGOKtL7/Au0Zlt1TXME9HD9E3HXKyE5K s2UvMQwfrX0tiqPM/5XN9LjCJrdFrImfMdMEAu9/6DXSUj/i6tnI1U/ueP56zk2V6Zgx GSsyZtfay3ERxq70iKMWgF4Ip0XGxeZaVbw0JGDPjxgFjHWycOksHWydHPZm/iabsJeI CEgS0lDDuy8JZ/ZudA9xvQHiAs3s2REgCCF1GFIrJnalb6Gr/PMbLHc9amN4k9vHNNWS tsxQlT8bqgDi/ajwnddv39ihnGUxSE/7i3nIHDAS8bDGOy4ccpv8Jryshhbr0C3Lp470 qf3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yN3NI4558XnAgcWdeQRXOWViZ0Qc4qBX0GV2hSfqTVk=; b=koll4rflxjUUapmzsmJoV9Ee+q3VaGFiLqGMjaY65Y1xBKUivKNkZgaRAl8HACjXRw UptWMgxTgSm7zLOUEAYBT8Li7qM5xH+P0plDVJs1JjzP1z1Qf3WPPThy90rpnbu2fLpM FJ+/gWgt3ssmXHRygj6Rkx5j/qy9ieyvBjWrdiib2ZB2+RzSprNSXU8cB4DN7pOP4JRX fjzKgfEYueW4H3Z6WrQwR0bSFPrIV1/xiCfYbk7FMzSSxRvtfd/9JHzxBeh4498HiPc2 K0n13Vcg4+hlcy1O6U/Ga3xlzzEl7pcK2nhtnRGLz+VsIX1z/fTz11/W9Vk1/qo8WFpM 1aJQ== X-Gm-Message-State: AOAM5311gTd2rq4JsJ+e2pgGfxZJx3AO44oHq1I1vA6pUoXdtDKyNAsh P4WNBAurn9JFx/Pln3KhkdcEHA75SNA8vZz1 X-Received: by 2002:a17:906:b003:: with SMTP id v3mr26153027ejy.770.1640891878502; Thu, 30 Dec 2021 11:17:58 -0800 (PST) Received: from tsr-vdi-mbaerts.nix.tessares.net (static.23.216.130.94.clients.your-server.de. [94.130.216.23]) by smtp.gmail.com with ESMTPSA id m6sm9918244edc.36.2021.12.30.11.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Dec 2021 11:17:58 -0800 (PST) From: Matthieu Baerts To: mptcp@lists.linux.dev Cc: Matthieu Baerts Subject: [PATCH mptcp-next v7 4/4] mptcp: allow sending both ADD_ADDR and RM_ADDR Date: Thu, 30 Dec 2021 20:16:51 +0100 Message-Id: <20211230191651.1831507-5-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211230191651.1831507-1-matthieu.baerts@tessares.net> References: <20211230191651.1831507-1-matthieu.baerts@tessares.net> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is mainly to be sync with what is done in mptcp_write_options() where after having written the ADD_ADDR option, we check if the RM_ADDR option also needs to be added. But if we have room, it makes sense to write the two options in the same packet. So best to remove the 'else'. While at it, also mention that mptcp_established_options_add_addr() can remove options. Signed-off-by: Matthieu Baerts --- net/mptcp/options.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index d06855e66007..c08d4b04458b 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -863,11 +863,14 @@ bool mptcp_established_options(struct sock *sk, struc= t sk_buff *skb, =20 *size +=3D opt_size; remaining -=3D opt_size; + /* Note: this can remove previously set options in some conditions */ if (mptcp_established_options_add_addr(sk, skb, &opt_size, remaining, opt= s)) { *size +=3D opt_size; remaining -=3D opt_size; ret =3D true; - } else if (mptcp_established_options_rm_addr(sk, &opt_size, remaining, op= ts)) { + } + + if (mptcp_established_options_rm_addr(sk, &opt_size, remaining, opts)) { *size +=3D opt_size; remaining -=3D opt_size; ret =3D true; --=20 2.33.1