summaryrefslogtreecommitdiffstats
path: root/net/tls/tls_main.c
diff options
context:
space:
mode:
authorValentin Vidic <vvidic@valentin-vidic.from.hr>2019-12-05 07:41:18 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-18 16:05:45 +0100
commit284504c24e88e6c7cb94eec10aa18ea187d2aa51 (patch)
treed63e7b265a3f120a432073c2357249ac9070cb4f /net/tls/tls_main.c
parent01e73a8cc49c8d818b56c4a9fd43910a47820a39 (diff)
downloadlinux-stable-284504c24e88e6c7cb94eec10aa18ea187d2aa51.tar.gz
linux-stable-284504c24e88e6c7cb94eec10aa18ea187d2aa51.tar.bz2
linux-stable-284504c24e88e6c7cb94eec10aa18ea187d2aa51.zip
net/tls: Fix return values to avoid ENOTSUPP
[ Upstream commit 4a5cdc604b9cf645e6fa24d8d9f055955c3c8516 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/tls/tls_main.c')
-rw-r--r--net/tls/tls_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index c7ecd053d4e7..07476df4b13f 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -473,7 +473,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;
}
@@ -782,7 +782,7 @@ static int tls_init(struct sock *sk)
* share the ulp context.
*/
if (sk->sk_state != TCP_ESTABLISHED)
- return -ENOTSUPP;
+ return -ENOTCONN;
tls_build_proto(sk);