aboutsummaryrefslogtreecommitdiffstats
path: root/net/tls/tls_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tls/tls_main.c')
-rw-r--r--net/tls/tls_main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index e07ee3ae0023..7b7a70e22d90 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -454,6 +454,15 @@ static int tls_init(struct sock *sk)
454 struct tls_context *ctx; 454 struct tls_context *ctx;
455 int rc = 0; 455 int rc = 0;
456 456
457 /* The TLS ulp is currently supported only for TCP sockets
458 * in ESTABLISHED state.
459 * Supporting sockets in LISTEN state will require us
460 * to modify the accept implementation to clone rather then
461 * share the ulp context.
462 */
463 if (sk->sk_state != TCP_ESTABLISHED)
464 return -ENOTSUPP;
465
457 /* allocate tls context */ 466 /* allocate tls context */
458 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); 467 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
459 if (!ctx) { 468 if (!ctx) {