diff options
author | Atul Gupta <atul.gupta@chelsio.com> | 2018-12-11 05:19:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-14 16:39:39 -0500 |
commit | 6c0563e442528733219afe15c749eb2cc365da3f (patch) | |
tree | e767c08bb65072e8c4fee7dd9614077439443d01 /net/tls/tls_main.c | |
parent | 2ab4c3426c0cf711d7147e3f559638e4ab88960e (diff) |
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: Atul Gupta <atul.gupta@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls/tls_main.c')
-rw-r--r-- | net/tls/tls_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index 311cec8e533d..492080306edc 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c | |||
@@ -543,6 +543,9 @@ static struct tls_context *create_ctx(struct sock *sk) | |||
543 | return NULL; | 543 | return NULL; |
544 | 544 | ||
545 | icsk->icsk_ulp_data = ctx; | 545 | icsk->icsk_ulp_data = ctx; |
546 | ctx->setsockopt = sk->sk_prot->setsockopt; | ||
547 | ctx->getsockopt = sk->sk_prot->getsockopt; | ||
548 | ctx->sk_proto_close = sk->sk_prot->close; | ||
546 | return ctx; | 549 | return ctx; |
547 | } | 550 | } |
548 | 551 | ||
@@ -675,9 +678,6 @@ static int tls_init(struct sock *sk) | |||
675 | rc = -ENOMEM; | 678 | rc = -ENOMEM; |
676 | goto out; | 679 | goto out; |
677 | } | 680 | } |
678 | ctx->setsockopt = sk->sk_prot->setsockopt; | ||
679 | ctx->getsockopt = sk->sk_prot->getsockopt; | ||
680 | ctx->sk_proto_close = sk->sk_prot->close; | ||
681 | 681 | ||
682 | /* Build IPv6 TLS whenever the address of tcpv6 _prot changes */ | 682 | /* Build IPv6 TLS whenever the address of tcpv6 _prot changes */ |
683 | if (ip_ver == TLSV6 && | 683 | if (ip_ver == TLSV6 && |