Commit 6c0563e4 authored by Atul Gupta's avatar Atul Gupta Committed by David S. Miller

net/tls: Init routines in create_ctx

create_ctx is called from tls_init and tls_hw_prot
hence initialize function pointers in common routine.
Signed-off-by: default avatarAtul Gupta <atul.gupta@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2ab4c342
...@@ -543,6 +543,9 @@ static struct tls_context *create_ctx(struct sock *sk) ...@@ -543,6 +543,9 @@ static struct tls_context *create_ctx(struct sock *sk)
return NULL; return NULL;
icsk->icsk_ulp_data = ctx; 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; return ctx;
} }
...@@ -675,9 +678,6 @@ static int tls_init(struct sock *sk) ...@@ -675,9 +678,6 @@ static int tls_init(struct sock *sk)
rc = -ENOMEM; rc = -ENOMEM;
goto out; 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 */ /* Build IPv6 TLS whenever the address of tcpv6 _prot changes */
if (ip_ver == TLSV6 && if (ip_ver == TLSV6 &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment