Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp465101lqg; Fri, 1 Mar 2024 10:21:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWtXuDL67HEW2VWphWRnoYqduoXPgtEN3+hqeQ5bGEQslislItpGWCaeZxq9eIz2LQYeyb2us899xGeFltiJ0JBxMiHjLu2TRBO8O0SyA== X-Google-Smtp-Source: AGHT+IEl2WJPG1A18XkuAS/IgAbKEolFnYNslo4GCdH9lmc8+axh335s4Tf3kH8peVvMKBJdXwtC X-Received: by 2002:a67:eace:0:b0:472:648e:4e45 with SMTP id s14-20020a67eace000000b00472648e4e45mr1605498vso.15.1709317303872; Fri, 01 Mar 2024 10:21:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709317303; cv=pass; d=google.com; s=arc-20160816; b=W0YHzBAhMklARfmBVG48cFOUJVPPAG9KVOAQMGiwcyl+wtEXbh+XnX4lH/fFANo6u5 tPmzAEjy28XuF8oBCcTHfQhgCE+y+MgWokYy7NcbiYfpVTiUI91tYENeJxs0AL+EbtcY qxz7YozPgsKYsI1WRjNXn/aev13lE4uz8mr2cIJzKC0GQpf42fNvlZd42N65pypfUhSv iMM7CQ8UeSPZhGQ9/uTCfSCOoX29DvAyyjnovfMhcBXYeYiR8mrq/ED8+fXCikKpNUv3 J4uGkhrGL+h/cmOZ8KeDpEOoDHjogLei9T0IpsQxmI97l33rJFvrQRDEVTQLKEXn4DO+ bjLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=4W/a8ZETV0E8eSqzABWlj8thxr1YCL1+dUOa5loYU0A=; fh=i1fHfqb3ms9PQICjX9LbYyHHX00fft5d6t57sCy1Fok=; b=yUUvpLLhJgd2/l/UacELog1kb7aNmxJ1K1dZS4FrxERD1d+QVChi0F+g6prsguJ02U Lvs6rac8nYGBF20jlRPtQKpldkQh/gFEioKIi5BGMJtmZcQML0ggo0slKU2AHWkM70/j 63+RsERDaviigntXHd724jajJT/BO3NcHSqdQXSQFqZTOhePjnnJ6a1Ha4gE7FtyOHoN XGKtYN3rKWdSoY2chm2BW4nspPv5Sh9b4kZzjQEjeuHaVWmrycKT75SC4Gyxeez8Xybf GjkGEuSz5XPVyvHUDIdtuEaG4VOER3YuTo/O9C8calHRj+e6w+bc+prVnM7qw1DedmJd moXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FsrWLWuy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-88905-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88905-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g11-20020a67cf8b000000b004706fcadea7si620402vsm.77.2024.03.01.10.21.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 10:21:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88905-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FsrWLWuy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-88905-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88905-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6C0AA1C20F54 for ; Fri, 1 Mar 2024 18:21:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8AA23D3BF; Fri, 1 Mar 2024 18:18:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FsrWLWuy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 064E23B785; Fri, 1 Mar 2024 18:18:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709317134; cv=none; b=qRUvFKzXvapsfbTTHm2fkP0fQW/IZf6kY0kG1nTUtwVs5hs6mKb/xxkY9mmVfDMFTi48S2tEWGkR4c8+T00Add/06nppMCri2ZY1oNdFVDGRhTieIRxKCrmn+mgA4UfTO5szcaCob8UBqdJku7pZCktaHQFCmYe3tY0/nGdb/0c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709317134; c=relaxed/simple; bh=2ulEk82mzCDQTc9Q4xsVEYZBuHiCFEEMnXuV8zumajs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ARUhVQHdXX/GYGntMWvxpWUjXS79zqbfZnRYgiPIrG1p1xm4ZTGolLsWu15BnsETP0aX+Dq/Df6kH9BDh3nORgA/T1okkpieHu1kTb2Vq3IOiBjHrf/5k+yMFj/yrskVSDkV5SUFv4Fh+jHH+npjsxI5gaJhXSg2nuTUSuywimk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FsrWLWuy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAAE1C433B2; Fri, 1 Mar 2024 18:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709317133; bh=2ulEk82mzCDQTc9Q4xsVEYZBuHiCFEEMnXuV8zumajs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FsrWLWuy1cuhgV57G20jSlnzmFnHHmMhHumQtZjkwGU9rPnyZ76ggu10m6kzzXvbC ShLKiFqfhxvfcQsBU0EoLYngKTlQMP0XfTKec5BVa0yHK6/HWX1LneMcy4x82b9rjQ adhAl4k9TngUFpYc+Y2dWxdNpTgFlWvRAztIoecidmd+/1CyNS3OoHP8EKlA3ROLNv pouvrJj/XCBEbT/FRiSZdAqzoXi/8jizTYi7lxoS4fG2AnczXrKBV1ikN59S8zxdLP Q34BVlC+c1GtZSz2lMKV1fHG77MCiS/H7SIfvYwU7Ci2mUYLlMrxWN3z8SiJpFoUBk gk2hrpfFy+93g== From: "Matthieu Baerts (NGI0)" Date: Fri, 01 Mar 2024 19:18:31 +0100 Subject: [PATCH net-next 07/15] selftests: mptcp: add userspace pm subflow flag Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240301-upstream-net-next-20240301-mptcp-userspace-pm-dump-addr-v1-7-dc30a420b3a0@kernel.org> References: <20240301-upstream-net-next-20240301-mptcp-userspace-pm-dump-addr-v1-0-dc30a420b3a0@kernel.org> In-Reply-To: <20240301-upstream-net-next-20240301-mptcp-userspace-pm-dump-addr-v1-0-dc30a420b3a0@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: Geliang Tang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1420; i=matttbe@kernel.org; h=from:subject:message-id; bh=hiJ4UAaexdDdOkDMA90vHJxSvQ7TaHeYuKTyQ9X/yhQ=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBl4hv0hsDs/1Pa/GzXfDIT9DqD+yjEj9kpfYLNs 1i6ujkWj5uJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZeIb9AAKCRD2t4JPQmmg c7AoEACJ8g1KYDvlpmYv1fWLTanHLx/uzyfz4MCfgZ2ecgZT1TxBEucPB2HA3z0I9AAMb+yzbvY y5lz9tc+OG2BszlB1Os7kqvKuOS5j2oIX0cB9/fIfyewK0BC5dPmw5Dxx8nhKTIP+XJE1hUCHJq Jwe2cDcE+XzESyrHwIohfMiQDmFVDXEYRsbors/VLpP22aC7vjJL9GK7CO6q56E8CK3tMdKtEZI m5i+OxEx90+Omq1roKrFu6SO/0ERKK2cZ6qJbT4n/LP+X1rYXYcbuXVc9sa+NsUOhhVnOVB4mJt QdanLxiu03TGJgirap/YLc+qQ6t+wXydNOQBZJoCUdgUWqSjYxg0i3BpZ/BrPjJvirkI8MfSyin +SF1W9fnFgkocAFHKTW7z9sPc/BnvPs+1M0EE1NwaQsg7nzqCpeAdgdkM40LGSUeZP/mPESPSQ8 MUCu3p2M5XWXA/4CY4nc0IX1ofLaXBYJ4GhOuYAerKTChp9vfXetlGQX0rF87IA6eHGUh/tP30v AjVX1UOs4EjisrUMoRk2xLqMnt4HibFIWg/btKys0soDSU0lTT7LSKV6nhAJm/WD96n6C8P/P8+ DDNb9Pb8bhv6WzJj3mDgjF99ynvncffqpsTUGkjVuaVulxCrvdsE0sTQEx+nSa5eagomAEGvzmB 1qrZ3N3QZTe8mNQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Geliang Tang This patch adds the address flag MPTCP_PM_ADDR_FLAG_SUBFLOW in csf() in pm_nl_ctl.c when subflow is created by a userspace PM. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c index 49369c4a5f26..e97856323ec3 100644 --- a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c +++ b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c @@ -453,6 +453,7 @@ int csf(int fd, int pm_family, int argc, char *argv[]) char data[NLMSG_ALIGN(sizeof(struct nlmsghdr)) + NLMSG_ALIGN(sizeof(struct genlmsghdr)) + 1024]; + u_int32_t flags = MPTCP_PM_ADDR_FLAG_SUBFLOW; const char *params[5]; struct nlmsghdr *nh; struct rtattr *addr; @@ -558,6 +559,13 @@ int csf(int fd, int pm_family, int argc, char *argv[]) off += NLMSG_ALIGN(rta->rta_len); } + /* addr flags */ + rta = (void *)(data + off); + rta->rta_type = MPTCP_PM_ADDR_ATTR_FLAGS; + rta->rta_len = RTA_LENGTH(4); + memcpy(RTA_DATA(rta), &flags, 4); + off += NLMSG_ALIGN(rta->rta_len); + addr->rta_len = off - addr_start; } -- 2.43.0