Skip to content

Commit

Permalink
net/tls: Init routines in create_ctx
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
chelsiocrypto authored and davem330 committed Dec 14, 2018
1 parent 2ab4c34 commit 6c0563e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/tls/tls_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,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;
}

Expand Down Expand Up @@ -675,9 +678,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 &&
Expand Down

0 comments on commit 6c0563e

Please sign in to comment.