summaryrefslogtreecommitdiff
path: root/net/mptcp
diff options
context:
space:
mode:
authorMenglong Dong <imagedong@tencent.com>2023-01-06 10:57:21 -0800
committerDavid S. Miller <davem@davemloft.net>2023-01-09 07:30:50 +0000
commitade4d754620f6d605705bf337aedef115158697e (patch)
tree07a70542a082e7ac8c6ca8fc94c9b6f322afebbe /net/mptcp
parentcfdcfeed6449d702825d249cb85346ecf56236fc (diff)
mptcp: init sk->sk_prot in build_msk()
The 'sk_prot' field in token KUNIT self-tests will be dereferenced in mptcp_token_new_connect(). Therefore, init it with tcp_prot. Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Menglong Dong <imagedong@tencent.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp')
-rw-r--r--net/mptcp/token_test.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mptcp/token_test.c b/net/mptcp/token_test.c
index 5d984bec1cd8..0758865ab658 100644
--- a/net/mptcp/token_test.c
+++ b/net/mptcp/token_test.c
@@ -57,6 +57,9 @@ static struct mptcp_sock *build_msk(struct kunit *test)
KUNIT_EXPECT_NOT_ERR_OR_NULL(test, msk);
refcount_set(&((struct sock *)msk)->sk_refcnt, 1);
sock_net_set((struct sock *)msk, &init_net);
+
+ /* be sure the token helpers can dereference sk->sk_prot */
+ ((struct sock *)msk)->sk_prot = &tcp_prot;
return msk;
}