summaryrefslogtreecommitdiffstats
path: root/net/mptcp/token_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mptcp/token_test.c')
-rw-r--r--net/mptcp/token_test.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/mptcp/token_test.c b/net/mptcp/token_test.c
index bfff53e668..4fc39fa2e2 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;
}