From nobody Mon Feb 9 09:51:57 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6638:38c:0:0:0:0 with SMTP id y12csp584324jap; Wed, 5 Jan 2022 07:57:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8IksQ+0i3YcRMoaurwLtkhq32SSqM9A25wQ5grJ09U0xCn34I76XF0VpxRj1U7QM0A28w X-Received: by 2002:a63:b905:: with SMTP id z5mr32716015pge.245.1641398261835; Wed, 05 Jan 2022 07:57:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641398261; cv=none; d=google.com; s=arc-20160816; b=rYJZfdEhexJyFCH1MY7mt+cvsK0Y/sJu2XZHzPj1FBC25vpj/hbe4cgciszmz4Pgl6 onzuxeoLjFB31SgsVhqPtkqRkSiFC93ZV1xemg/RCXgqMLAFF+nfetZcANf6iAzKmsB3 wiqyndH/yC+5cF2mSaXft6zsBUdzidH806QF2lyOze8Av32MgF8NOpoTzmJe5YX1flgf uMNVDCxRU4u9ks2CTVbJPKqtfjdP1AU1SXnt23PE1QFAMePz+iUUiwS9e2+5QiNSjd3S GUoXDY0/+IShNL0w+I7LJS7UDlS/OiyRhT0Ck7ifYY30jRkmlx3g9NGvY2XRX4hZQmTd P7Yw== 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=eUDvi1snSI8RgS26pUudf/i3rGeVB0SFTUvO9vgaQEY=; b=0VBx7viFwr/RXkFVzonMVt8NmWDB/yyWkcEkdo8pT6VcxPorL6epBiWcdH/NxgK6VZ mIxHeg1XPzEC1/mk/P4Qj+IwdDiVBUrHGTt1cJ4BJgwTiS8H2Pa/qQZRCu260o01eBju aD8lvPgfVIW1D1y8+llgem356wUMXm3Iv/G197A5vgZFBeb4gCxBtW5MLYIYC9NC6eYh 2P2OOF0qbI6wAcEiwzLFK6opurVnBdVJdrP3+m2tYczYXJFQWKdyu6y+9PMx5AW+fSjW sc0D3y3xLtM8m4umDcByLS7gKGd5lJUQg7Jh294g/Ji3zOVUTvC3GA8phv5JKd/F3SOA f+Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b="GylllEw/"; spf=pass (google.com: domain of mptcp+bounces-2915-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2915-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 s17si36970558plq.235.2022.01.05.07.57.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jan 2022 07:57:41 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2915-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="GylllEw/"; spf=pass (google.com: domain of mptcp+bounces-2915-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2915-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 4C7443E0EC0 for ; Wed, 5 Jan 2022 15:57:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B85F92CA1; Wed, 5 Jan 2022 15:57:35 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 17ECF2CA7 for ; Wed, 5 Jan 2022 15:57:34 +0000 (UTC) Received: by mail-ed1-f43.google.com with SMTP id b13so163815791edd.8 for ; Wed, 05 Jan 2022 07:57:34 -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=eUDvi1snSI8RgS26pUudf/i3rGeVB0SFTUvO9vgaQEY=; b=GylllEw/0Ra4qtJvR/YAN2jqK0I2v6rXt5EtJDeg+ga8zfruCO9nNdzzZnPaSU+BQR mXQ1hnoW9Ner/3Caw/jWEuggCBlByf3z2T23YpItuF3k6v7njy0bny6xPfEYQiBWwDDR W3ETEvpeQ9jTKJcyGH6INITqz0pk0PEJ7p70c563yDrkXt+1mmcch2JmbimckKfZT032 lybVZJ5C74SGmhcWGzfmPMtsh8kuTJumiKj1cy3RMlZXKOms+VAOIp+2N1o4k4jO507F Sf116AdWV5WkgzvnYykLvT593s1O/8tq73xSEKFSM5zzwEHnkQERTmyu8ZHYSO3boJe/ qSiQ== 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=eUDvi1snSI8RgS26pUudf/i3rGeVB0SFTUvO9vgaQEY=; b=nQP2Y8iShydxikEcYn90EEnTgPWPBAKb+C3PS72NMq42GB12DvVAhuHJ9iM5QY/CWL R6Rdf7gKJyp6KZVgVjls+4l/hDWOUyotkBLBP5jZuxH4y3Zd6sgg8Y5nlY2iP+xkXSB7 JG7UupLusEds1u5ChKvve2orXjwDA4smUs+5GgS6290ya6OKk1jnTGHg4ybeMsUaQMlo p4Penl4HQavTAdc0RYqPcFMj3jWxNvufPfkO/Sa0iXEWhqQlnqA85J4gbNUI/Sl1yW2Z ZX8CIIVr3aZz+FU9YzGdmKZoVJhavZMvX6vQNxIjq9gpstovyyw6g08n9RmgnBQZqRuI 166Q== X-Gm-Message-State: AOAM531oNhGGo26hKipU0hUI85ddkgsiTI+YA/5INX+a8PUHh2Q4fKQq E5amTsZK5PXClkkkQkV3JN5ELL5ZeHIYTXXB5XE= X-Received: by 2002:a17:906:974c:: with SMTP id o12mr42064770ejy.229.1641398252265; Wed, 05 Jan 2022 07:57:32 -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 c30sm12399684ejj.190.2022.01.05.07.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 07:57:32 -0800 (PST) From: Matthieu Baerts To: mptcp@lists.linux.dev Cc: Matthieu Baerts Subject: [PATCH mptcp-next v8 6/8] mptcp: allow sending both ADD_ADDR and RM_ADDR Date: Wed, 5 Jan 2022 16:57:00 +0100 Message-Id: <20220105155702.165123-7-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220105155702.165123-1-matthieu.baerts@tessares.net> References: <20220105155702.165123-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 8553b928c5bf..06f64101d27b 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -864,11 +864,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