diff options
author | Valentin Vidic <vvidic@valentin-vidic.from.hr> | 2019-12-05 07:41:18 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-12-06 20:15:39 -0800 |
commit | 4a5cdc604b9cf645e6fa24d8d9f055955c3c8516 (patch) | |
tree | fbf990cba5f852a84307f6cbbba7a4c08e344a5b /net/tls/tls_main.c | |
parent | 1af66221a66de080274540a5c481ddacbe3574d2 (diff) | |
download | linux-stable-4a5cdc604b9cf645e6fa24d8d9f055955c3c8516.tar.gz linux-stable-4a5cdc604b9cf645e6fa24d8d9f055955c3c8516.tar.bz2 linux-stable-4a5cdc604b9cf645e6fa24d8d9f055955c3c8516.zip |
net/tls: Fix return values to avoid ENOTSUPP
ENOTSUPP is not available in userspace, for example:
setsockopt failed, 524, Unknown error 524
Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index b3da6c5ab999..dac24c7aa7d4 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -487,7 +487,7 @@ static int do_tls_setsockopt_conf(struct sock *sk, char __user *optval, /* check version */ if (crypto_info->version != TLS_1_2_VERSION && crypto_info->version != TLS_1_3_VERSION) { - rc = -ENOTSUPP; + rc = -EINVAL; goto err_crypto_info; } @@ -714,7 +714,7 @@ static int tls_init(struct sock *sk) * share the ulp context. */ if (sk->sk_state != TCP_ESTABLISHED) - return -ENOTSUPP; + return -ENOTCONN; /* allocate tls context */ write_lock_bh(&sk->sk_callback_lock); |