From nobody Thu Mar 28 08:25:13 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:a689:0:0:0:0:0 with SMTP id j9csp370902jam; Wed, 22 Sep 2021 06:57:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDdmtQol1onkg8O7T3zQRxVRmkgtqtoYGBNz5edBXfomvuLGbLm1ZeQUtucjBN9rLyipXZ X-Received: by 2002:a63:4f0d:: with SMTP id d13mr32544063pgb.169.1632319029099; Wed, 22 Sep 2021 06:57:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632319029; cv=none; d=google.com; s=arc-20160816; b=m9ybs5jLANosqbx6po2rpx1suYMZCLykkJj+j/6eHlek/L7euHl5rT5YQOGyFpUR4f 2/DzrM+H7rRKB1GpfImQ8cBziyaJzqlGT2lGHojLuRKJVBKtBNb3WJqdNrG8zivK3hXW eLzfnhMk2YpZo8QPmAocdwBQ5wFcmnLyrukNEueGDJZgKxGoHbaTZW3GYEeAgZfSWaJJ NzALTassgzSYG/TBT52aFF/xvkgRUuuRKHp1JhxiZFrtM+qD3llxNqqkGk5rYex6nOr1 H2IZpmoBUTFYL+69bZTJgK2EBu9q9LuRtAn0k9Kz51H/6DBCYjYEZ+bBQ4FhPorugJeU VpIw== 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:message-id:date:subject:to:from :dkim-signature; bh=ezdUV84TLbffOtnbSVvVLt3E9JdP6mesQWd1UglVhg8=; b=c5LjBZ89x9cSnQ/SgHZJNGPGvFnExbWegku2536ExDvm+Pl+Os+5c1iUXVt9ibB7gT ZLYEnSlBXAa4zbaSVKPTX+n7KWI5OmuoIaR3o7Pz3NPMzf6ULe+4SdW+VvYen2TsZd7a k78ZXHHUGcx3jVlxjczPRhR9KGVsoRhzhFGups+YsvekwFBtg/ofYa5fa+bjuW5w7ybs 9X0LJr1HhHHjiBeJbmp8a6ddx0qvhg5j4lzEWQpLDQBQrYZbHmYf1QKWebsJW4C56+CI 80fbFU7GuF46wb9AINWkFSLegabY22k+vNEuyGHPfeTaZPfraFSB02YTdIE1bDaZXvhc MWWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fde6Mryh; spf=pass (google.com: domain of mptcp+bounces-2009-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-2009-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [147.75.69.165]) by mx.google.com with ESMTPS id q4si2559655pln.264.2021.09.22.06.57.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Sep 2021 06:57:09 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-2009-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=@redhat.com header.s=mimecast20190719 header.b=fde6Mryh; spf=pass (google.com: domain of mptcp+bounces-2009-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-2009-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 4D2643E0E4B for ; Wed, 22 Sep 2021 13:57:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D16672; Wed, 22 Sep 2021 13:57:07 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (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 744843FC5 for ; Wed, 22 Sep 2021 13:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632319024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ezdUV84TLbffOtnbSVvVLt3E9JdP6mesQWd1UglVhg8=; b=fde6Mryh4yZwwuf8BPJa35eqjT/B3cYZRDdoZyCFEleibY8HnKDRTk/Op8CMHqFntvdbf0 hFUWqR/n+9MhfDhhGN+ZWxfJ876J643nvbGz00QrEPmFrwRc1w6sBZRe6MKgWPckSA7G+v qG5gjfkcCWqiqViyk/Jg28gyHSVfwmg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-513-gjj5jEMrNsyZf1rOFT09WQ-1; Wed, 22 Sep 2021 09:57:03 -0400 X-MC-Unique: gjj5jEMrNsyZf1rOFT09WQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 086EC10151E5; Wed, 22 Sep 2021 13:57:02 +0000 (UTC) Received: from dcaratti.station (unknown [10.40.194.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1717218428; Wed, 22 Sep 2021 13:57:00 +0000 (UTC) From: Davide Caratti To: mptcp@lists.linux.dev, Geliang Tang , Mat Martineau Subject: [PATCH mptcp-net v2] mptcp: allow changing the 'backup' bit when no sockets are open Date: Wed, 22 Sep 2021 15:56:44 +0200 Message-Id: <6fada33a17044e54f0ba5b3a5dc35987cbea3b54.1632318877.git.dcaratti@redhat.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dcaratti@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" current Linux refuses to change the 'backup' bit of MPTCP endpoints, i.e. using MPTCP_PM_CMD_SET_FLAGS, unless it finds (at least) one subflow that matches the endpoint address. There is no reason for that, so we can just ignore the return value of mptcp_nl_addr_backup(). In this way, endpoints can reconfigure their 'backup' flag even if no MPTCP sockets are open (or more generally, in case the MP_PRIO message is not sent out). Fixes: 0f9f696a502e ("mptcp: add set_flags command in PM netlink") Signed-off-by: Davide Caratti Reviewed-by: Mat Martineau --- Notes: v2: - ignore the return value of mptcp_nl_addr_backup() rather than just gixing the case of 0 open sockets, from Mat Martineau net/mptcp/pm_netlink.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index c4f9a5ce3815..c3722eedc671 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1718,10 +1718,7 @@ static int mptcp_nl_cmd_set_flags(struct sk_buff *sk= b, struct genl_info *info) =20 list_for_each_entry(entry, &pernet->local_addr_list, list) { if (addresses_equal(&entry->addr, &addr.addr, true)) { - ret =3D mptcp_nl_addr_backup(net, &entry->addr, bkup); - if (ret) - return ret; - + mptcp_nl_addr_backup(net, &entry->addr, bkup); if (bkup) entry->flags |=3D MPTCP_PM_ADDR_FLAG_BACKUP; else --=20 2.31.1