diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index 7fab2891ce7f1ce1e725324de22478e93627ee28..a091c03abcb2800c1448bf6a6a7f34b5b7807423 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -555,6 +555,9 @@ static struct tls_context *create_ctx(struct sock *sk) return NULL; icsk->icsk_ulp_data = ctx; + ctx->setsockopt = sk->sk_prot->setsockopt; + ctx->getsockopt = sk->sk_prot->getsockopt; + ctx->sk_proto_close = sk->sk_prot->close; return ctx; } @@ -685,9 +688,6 @@ static int tls_init(struct sock *sk) rc = -ENOMEM; goto out; } - ctx->setsockopt = sk->sk_prot->setsockopt; - ctx->getsockopt = sk->sk_prot->getsockopt; - ctx->sk_proto_close = sk->sk_prot->close; /* Build IPv6 TLS whenever the address of tcpv6 _prot changes */ if (ip_ver == TLSV6 &&