From nobody Thu Mar 28 20:15:18 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:1d48:0:0:0:0:0 with SMTP id 69csp1432415jaj; Thu, 16 Sep 2021 12:52:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyY7YZ5ABHlWIDf/vzQYidvHzsTTiuteVowDqR2VuyaGL7TiKg/0eBHrC/4qq9+r1+Pq0w X-Received: by 2002:a63:b349:: with SMTP id x9mr6419429pgt.139.1631821968294; Thu, 16 Sep 2021 12:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631821968; cv=none; d=google.com; s=arc-20160816; b=jQPq2A1MmXtBJessjfof2eeR2lHNgUTqh6hotcZ3/L5V5VnU+iXdgOvo83itVuXCDm aAMaSIpV0CVZxj/pn/9y/yn1TNEaAniSptfiMitUwzugqpeGTs8IkGMkrgmfRIYY53Aw aPyRavKAsfLVO7ii2VgcZECXNEvXyDqWWiH3dSeh9wsJr/30lJuTL8WFdlFBIWaMIvxH MY5kQfmQtfrTTFYEmWsE43pr26f2ZhwL4eOtVXHo1U4E9eZpq+43FxPmh2Id1TThNsXt jPrzOWHSD9xGHa3Xiww3DcMyNc0XS/RGwICl/4dQCj6ju95MNabnGF9+vewxcR5Q5X2q 4cdg== 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=Nmkdw8wTTqs2u/2XZ3OIow9EyLZzmiLWkLf42zuLkd4=; b=M4pNPDixpCXjbp1BAQBtnr77TRso/jpZMAv1Mmj7i4/rFFXgF06Eyk21NRXQiEsSRJ /CvKelNuv+hs1cZhH9u65TvC52Cub3PaCFvq+bztIiXuz8qZDElS6Qqf1nmJgK2Cj76Q QJ4qdNqoawgSsPYW4Dai60ljaZ5vqEfWXbsUknuzL/I3G2YrePWmgBOw+xb0Mf8qydJm efVzUWsKdRTmKJT4efgm3h+FeukStyurkbRBn9eIogPwbOSU9K38iyMecWA/lQsdXM9L x9/q9wLQHZkQKvomeOAvqngKLe0cjnI7Zkw2OYpZDwew92Ccb0qKARrGploVBcBkzzNe NU5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="VtrV5V/V"; spf=pass (google.com: domain of mptcp+bounces-1944-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-1944-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 q4si4672265pln.80.2021.09.16.12.52.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Sep 2021 12:52:48 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-1944-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="VtrV5V/V"; spf=pass (google.com: domain of mptcp+bounces-1944-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-1944-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 7446E3E1058 for ; Thu, 16 Sep 2021 19:52:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5727A2FB2; Thu, 16 Sep 2021 19:52:46 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 57E953FC5 for ; Thu, 16 Sep 2021 19:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631821964; 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=Nmkdw8wTTqs2u/2XZ3OIow9EyLZzmiLWkLf42zuLkd4=; b=VtrV5V/VpZPP3UQqMKQD2QpXZNsIdBOfCXkN68xy5/BmjR3snWsFuE+H94cF7r/nNdL8Oc Ocp3pNPfVQZIrTVzm7bZLV/YkRGlYdpssf2td7R/liArIxObRW2PVRUlXyNDDyX7GhOLSp tlpxSRPiuNnGLAT2sqIrm7iAUG9jR78= 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-310-zOYq-MGbMMuWwQg2687DFA-1; Thu, 16 Sep 2021 15:52:43 -0400 X-MC-Unique: zOYq-MGbMMuWwQg2687DFA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D79F824FA7; Thu, 16 Sep 2021 19:52:42 +0000 (UTC) Received: from dcaratti.station (unknown [10.40.192.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7934E7E464; Thu, 16 Sep 2021 19:52:41 +0000 (UTC) From: Davide Caratti To: Geliang Tang , mptcp@lists.linux.dev Subject: [PATCH mptcp-net] mptcp: allow changing the 'backup' bit when no sockets are open Date: Thu, 16 Sep 2021 21:52:29 +0200 Message-Id: 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.13 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 make mptcp_nl_addr_backup() return without error even when 0 MPTCP sockets are open and no MP_PRIO message is sent out. Fixes: 0f9f696a502e ("mptcp: add set_flags command in PM netlink") Signed-off-by: Davide Caratti --- net/mptcp/pm_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index c4f9a5ce3815..8a7048c5b9b4 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1678,7 +1678,7 @@ static int mptcp_nl_addr_backup(struct net *net, { long s_slot =3D 0, s_num =3D 0; struct mptcp_sock *msk; - int ret =3D -EINVAL; + int ret =3D 0; =20 while ((msk =3D mptcp_token_iter_next(net, &s_slot, &s_num)) !=3D NULL) { struct sock *sk =3D (struct sock *)msk; --=20 2.31.1