Skip to content

Commit

Permalink
tls: rx: move counting TlsDecryptErrors for sync
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Apr 13, 2022
1 parent 0775639 commit 284b4d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/tls/tls_sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 284b4d9

Please sign in to comment.