From nobody Thu Sep 18 11:14:16 2025 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6638:38c:0:0:0:0 with SMTP id y12csp1818901jap; Thu, 6 Jan 2022 14:06:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrJjymcHNa+OVac9uHDmbxpvsDD8TFEwq2b6pTtr7NH4K1+D/wqloyEHDFzJusiOotpa0d X-Received: by 2002:a17:902:7609:b0:148:daa5:8133 with SMTP id k9-20020a170902760900b00148daa58133mr59041960pll.48.1641506809184; Thu, 06 Jan 2022 14:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641506809; cv=none; d=google.com; s=arc-20160816; b=B1RS8CAgfp926MB/RjiB71wFAtM8T9RE5Ykk3112EAib1lZZejVkEuH4Mrvj5LDkW0 8nyJTk3tfChmTbceVHsEXjJqnA0xjNJAxcBiOTWmkcNymLQKoOcLmz27KyxMSDlZ0DUI TBkHuarTaEYEtyq/JcJTk3/i9fr3xEa8G7Ub2IF+NtN/yvAdb2vHjMRpj/QBhLSeJ3zb jpvzabFFBgj0wtqzhJ86p6dKV4dBkptQi6YhEE/jjuDUpC1WrjpUcUryIzMOttpUXPnS u5xoo+7yTpaRXW/hjEjHlahrSiEvJlz2TS/nCTIi3xZCVnIgyMImICaoRMyXWwdf0NvR 71IQ== 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=lin3wCwaGjYpfXJewWBvftweJGPcAZ6hUaq5DjY0nlM=; b=jvR+SA+dOdP8ySB7UtxXJ4B85TZ46yGiPtSK+a9kid6qrs3L7o/SuOevAzhm8rJYR0 vK78boqDu7JhmcORN7CNWJui9zI+gObFXknTIwkJYRQqO2WeR/99lNyfT2aNYLmZrBEE th0hriJTP8Z1lPDtdxPVvghy/5c8TSVqD+/I9hpLSQ5838Qp9o90iV2fZyHMgbjQDXpU 8JVK/8Y+jOAmp4mupetnQYnlsZ0kxTIDIYL3lHZDq2GjdZNxqVMvsyzth77RLJ5RIi2a bEOgllJB+vlanF5d5/dHtM2cN5vky43yUGf5kSwwCmfoFLG5CC70wL1Tdzk4I/FUAnLh eVLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cy9NGjOm; spf=pass (google.com: domain of mptcp+bounces-2942-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2942-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [2604:1380:1000:8100::1]) by mx.google.com with ESMTPS id c5si3355937pga.608.2022.01.06.14.06.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jan 2022 14:06:49 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2942-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=@intel.com header.s=Intel header.b=cy9NGjOm; spf=pass (google.com: domain of mptcp+bounces-2942-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2942-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 B19033E0F3B for ; Thu, 6 Jan 2022 22:06:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 106672C9C; Thu, 6 Jan 2022 22:06:48 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68DC92C80 for ; Thu, 6 Jan 2022 22:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641506806; x=1673042806; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=byM8QVPpbwIKbaJxlpVhaFNX3ZO8Mil0UItZLC5oa4M=; b=cy9NGjOmS4YZ208fBZVdmOb7QUbNRa5Oaef4fZRVnJQxkhNQx0DNQQes pMI31kbPf2+Q7f2vLa00Q1wvzKlRRB9ZWlPmZgViTYV/1Ot5aAboWy0WM I0hY2xZvGtqo/V+zR7UHYmINMHTzNCvs+fDac8oXtf9/CM/d7l/FIFv46 q7fFmLyRsJIe06RX66ky9Fr+ghXENXhPHMA3bGPxuZOcG8TSQedRc7cN3 0KW00bOyanyKXTbhFq/ddaWppDadwDRBTAeS5QrQ7Uvmzt4GItazCn/3t UefkjbFP1O7qzXGZXWa9SdzXCJdxp8ZSsPL4u+QPb4B4vTlh7NsQrbO1Y w==; X-IronPort-AV: E=McAfee;i="6200,9189,10217"; a="240303707" X-IronPort-AV: E=Sophos;i="5.88,267,1635231600"; d="scan'208";a="240303707" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2022 14:06:43 -0800 X-IronPort-AV: E=Sophos;i="5.88,267,1635231600"; d="scan'208";a="618479813" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.209.94.200]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2022 14:06:43 -0800 From: Mat Martineau To: netdev@vger.kernel.org Cc: Matthieu Baerts , davem@davemloft.net, kuba@kernel.org, mptcp@lists.linux.dev, pabeni@redhat.com, geliang.tang@suse.com, Mat Martineau Subject: [PATCH net 1/3] mptcp: fix opt size when sending DSS + MP_FAIL Date: Thu, 6 Jan 2022 14:06:36 -0800 Message-Id: <20220106220638.305287-2-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220106220638.305287-1-mathew.j.martineau@linux.intel.com> References: <20220106220638.305287-1-mathew.j.martineau@linux.intel.com> 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: Matthieu Baerts When these two options had to be sent -- which is not common -- the DSS size was not being taken into account in the remaining size. Additionally in this situation, the reported size was only the one of the MP_FAIL which can cause issue if at the end, we need to write more in the TCP options than previously said. Here we use a dedicated variable for MP_FAIL size to keep the WARN_ON_ONCE() just after. Fixes: c25aeb4e0953 ("mptcp: MP_FAIL suboption sending") Acked-and-tested-by: Geliang Tang Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau --- net/mptcp/options.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index fe98e4f475ba..96c6efdd48bc 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -821,10 +821,13 @@ bool mptcp_established_options(struct sock *sk, struc= t sk_buff *skb, if (mptcp_established_options_mp(sk, skb, snd_data_fin, &opt_size, remain= ing, opts)) ret =3D true; else if (mptcp_established_options_dss(sk, skb, snd_data_fin, &opt_size, = remaining, opts)) { + unsigned int mp_fail_size; + ret =3D true; - if (mptcp_established_options_mp_fail(sk, &opt_size, remaining, opts)) { - *size +=3D opt_size; - remaining -=3D opt_size; + if (mptcp_established_options_mp_fail(sk, &mp_fail_size, + remaining - opt_size, opts)) { + *size +=3D opt_size + mp_fail_size; + remaining -=3D opt_size - mp_fail_size; return true; } } --=20 2.34.1