summaryrefslogtreecommitdiff
path: root/net/tls
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-04-11 22:19:10 +0300
committerDavid S. Miller <davem@davemloft.net>2022-04-13 13:45:39 +0300
commit284b4d93daee56dff3e10029ddf2e03227f50dbf (patch)
tree3870bba0f7315af819f11250ac1b23355d8b1e90 /net/tls
parent0775639ce1ca953503121e350d6b885366f56a52 (diff)
downloadlinux-284b4d93daee56dff3e10029ddf2e03227f50dbf.tar.xz
tls: rx: move counting TlsDecryptErrors for sync
Move counting TlsDecryptErrors to tls_do_decryption() where differences between sync and async crypto are reconciled. No functional changes, this code just always gave me a pause. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls')
-rw-r--r--net/tls/tls_sw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index fd19047fa6c6..fd970649d004 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -270,6 +270,8 @@ static int tls_do_decryption(struct sock *sk,
ret = crypto_wait_req(ret, &ctx->async_wait);
}
+ if (ret == -EBADMSG)
+ TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR);
if (async)
atomic_dec(&ctx->decrypt_pending);
@@ -1584,8 +1586,6 @@ static int decrypt_skb_update(struct sock *sk, struct sk_buff *skb,
if (err < 0) {
if (err == -EINPROGRESS)
tls_advance_record_sn(sk, prot, &tls_ctx->rx);
- else if (err == -EBADMSG)
- TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR);
return err;
}