Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp77364rbb; Fri, 23 Feb 2024 12:19:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUyMajAbmzGP1gT7rUHe0S/DX1LZ7SL1QMDDLGsC6pgcdV9L7bGM53nGAcIaZQk2XxI1Rl6o8x73px9jCjZkxQCu00YDm8JEJXjAFZfDA== X-Google-Smtp-Source: AGHT+IHc1GYr58TPv+sDw/TP3yTtPxHpxV1x9YBvrKKLbAVYSUHkrvMBJKuEc9nxZdvYC/cDXawH X-Received: by 2002:a05:6a20:c68e:b0:1a0:e8f3:151e with SMTP id gq14-20020a056a20c68e00b001a0e8f3151emr441974pzb.1.1708719589580; Fri, 23 Feb 2024 12:19:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708719589; cv=pass; d=google.com; s=arc-20160816; b=GrsQgdhYnGvFNOpIXsivyL2iWXcePtW8AeojGk7JAIBn3dkn+OofBEX5u/19vBfOnO jg0KIqExB7zsNTJUJnnCMrEA5UhhCSqPWzJB6xdbpJhj/cjjWet+KfTKK4ixEbJDtRsg EzSNOPwdVONyOJOln7Qk0nKdzwWV5WQNI3oKVlhIFNGjsNL3epVoACc2pZlZspl67PCn 8vLm4YJOfosMg7cdDe2Jeij//GGULoE1qh5KUwKdEJ8pBdLz/xkIVWp/Jvijzr4WYq1A 9fsvd9LMLWKDgypTsCRgsBcxrJD0CYtC/oEya/Xo8uf9mjRxouH3iB60h0T8PDfDWIa2 HTjA== 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=IX/3atdoMMNke9J8LvEuQNLuWRS3hLOsIO686/wPLe4=; fh=Z1YWgvxkmJ0/+y4FkLRSZ5mzUdtmyDAS67SU6REkp38=; b=DxGxEK6tGlxGpzQIplZFsFjjPrOZ7nuS3ZYzRZUc0kd7rL2c7VnpWdlIltCfSvRwFT KFu/QP7ExYDQl3sy3BwoJAe3hYq2LCpyiIEVF0mjYwBCvt3X/xUv5whSrXDgC20xI4x2 02u9l+PhS2JK1QXG1s75OvLkj88oowWJaCJeUTijkgjJTMcI1N0cb/RFfqyTkE7hvuQg C9Ps9Ii1Sr3zk+u8lq1AlTC+DFbXu/pdjjm/bADNbPVINXYf0UOUokKTwKD4plsbKkoL mHoovqWcMFFDKONNz+5G9OUU/iHXZd2s+gE1gAfx4zGbNksXlkyF5Uwfb1ne6R56FiZ5 1Dng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sBpChH4u; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79084-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79084-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l184-20020a633ec1000000b005d8c118be4dsi12651375pga.136.2024.02.23.12.19.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 12:19:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79084-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sBpChH4u; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79084-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79084-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A8E3E289F29 for ; Fri, 23 Feb 2024 20:19:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 180E914C5BE; Fri, 23 Feb 2024 20:19:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sBpChH4u" 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 319FE14938A; Fri, 23 Feb 2024 20:19:04 +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=1708719545; cv=none; b=syCak26xb6FpjUhuJtnXi8BNJWBrE9Z63iUTOXf4d/kZd4n7uz05630NSSS64z4Q/mS0Jl6/C41NoLPOPHtJQW2uLUB+kOjiIJGj0tiOlmwrC7ViMhwdhblYo5J0cLZ5pu9ffr58j40dwPtOWuBU2Rqqlx9KSRhfxzQaKbNr0wg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708719545; c=relaxed/simple; bh=Dm6ZdORui82/8VoYa4bD5q/6VoXige1uFQXuWG3HMks=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SrnqrAdN52uY3DbnkMG6uqxP003ynq7onolVinf8nIJolnGdLWhiGKaWjouppeAbQ5RIXnyuxsNb68/+nxu6kNk0w54jHy75Nt+/UmyQbBewP8eOBgHBP/jXySeHL5OxtBcqMhmlUwiXQlCqLvV9YPfEWE/S1dY5rfdkS2DNzBI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sBpChH4u; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AED8C433C7; Fri, 23 Feb 2024 20:19:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708719544; bh=Dm6ZdORui82/8VoYa4bD5q/6VoXige1uFQXuWG3HMks=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sBpChH4ubXj9H2Rq6Zjdq1N8SM3jKzp/2P5UcRMCsk+oNWuTfWTikoN32ya4NJxvN waNiAHkJsQJeAOSPtWISoAmE4U4SixqmrRJpj2yltbcOFlpXtijD8IvuhE6hWEoj3J ZKI0lQlDEVGuKU7NzaiITE+7UwkqFhnK1nFHU8Xt7GhK5Z5CJ6lb15uaPid6c+Yiwp iz4Iz6wq4bDcAchlR4CSbkzGW04c/7f9fAVsw9o9EOT0YONSyooThTGssr13bv8Odn Vl8wXRrwk2BJtE5NelQZ3ZCtysYE8rbs1XURb72/jDu03hQLqRLX9GK+0gePih3s2u SBc+gQsId5SkA== From: "Matthieu Baerts (NGI0)" Date: Fri, 23 Feb 2024 21:17:54 +0100 Subject: [PATCH net-next 2/8] mptcp: token kunit: set protocol 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: <20240223-upstream-net-next-20240223-misc-improvements-v1-2-b6c8a10396bd@kernel.org> References: <20240223-upstream-net-next-20240223-misc-improvements-v1-0-b6c8a10396bd@kernel.org> In-Reply-To: <20240223-upstream-net-next-20240223-misc-improvements-v1-0-b6c8a10396bd@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1235; i=matttbe@kernel.org; h=from:subject:message-id; bh=Dm6ZdORui82/8VoYa4bD5q/6VoXige1uFQXuWG3HMks=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBl2P2q2eS9x43GC5y4A1Ev0Db4KVnezwT0MGWbc R/lDEWzoIKJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZdj9qgAKCRD2t4JPQmmg c7jnD/4jD0nW63U92fD3F/Fzyx81Zku0ZzjDDRDfwaZC5/HajMUrJmOWRY24NV0oHlkMYa2J6kY jpLpuJyu7+Y8J9L5wTpdKKGIGi7pOSuB9JZQBgjYRBlWsK2nVPbgSJ756oHJPekgEM7nXsCElfO mOoq8VG1Qm4vWDxIqxUdBp9/8oiOKN4U3OwQUFxJvMBjxtgH3PxEEV6C2x49oPkfyVWW4bMGFt9 yVJNcDiZn79hgc+N0Zl0fG0XLNrR99IOCydPxrQKzdwkqRrhGtG7OnAkoBJSQAcrUSrka/WnXC/ oU7h6RJXdPVb3y8jccAGdgJ/KBhkGIlF6w2bqmQe+9jgrlvY1dp+gAs56Ivgy11kyNKr6kShrzh eTgR8KiFg397D/U8YNtVfgWkln52tW+ve0DGUGAgaWBiAtEkP9Lm3xv3RTt5m85JJmyXWVbZ5Jc /dzLFX7X3gOUDCZ0Bq/cGJnm98DEMTStHCfAQwP0cFQSgwlmWjDomyw5WnkLsZ/EzX5MFn2ywMf ynE0SSyY5b5+tP64CauPOky8+cLM5Dl8mj+foz6KJDOKvZrB577STwUK0XsgQ/ZSbo0PbpTt7u4 aPqvTj8fyvVtKmVWq8xxNb/7KhwtzsjM+PTr9Tvv0oPvrNVhA0YNQWGgq/4ulnLcoS2Z3Bil1Z6 OXcc9tkgFMzHwqw== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 As it would be done when initiating an MPTCP sock. This is not strictly needed for this test, but it will be when a later patch will check if the right protocol is being used when calling mptcp_sk(). Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/token_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/mptcp/token_test.c b/net/mptcp/token_test.c index bfff53e668da..4fc39fa2e262 100644 --- a/net/mptcp/token_test.c +++ b/net/mptcp/token_test.c @@ -52,14 +52,19 @@ static struct mptcp_subflow_context *build_ctx(struct kunit *test) static struct mptcp_sock *build_msk(struct kunit *test) { struct mptcp_sock *msk; + struct sock *sk; msk = kunit_kzalloc(test, sizeof(struct mptcp_sock), GFP_USER); KUNIT_EXPECT_NOT_ERR_OR_NULL(test, msk); refcount_set(&((struct sock *)msk)->sk_refcnt, 1); sock_net_set((struct sock *)msk, &init_net); + sk = (struct sock *)msk; + /* be sure the token helpers can dereference sk->sk_prot */ - ((struct sock *)msk)->sk_prot = &tcp_prot; + sk->sk_prot = &tcp_prot; + sk->sk_protocol = IPPROTO_MPTCP; + return msk; } -- 2.43.0