Skip to content

Commit a8bc823

Browse files
committed
tlshd: Pass ETIMEDOUT from gnutls to kernel
We've had some QE work that's created a condition (some types of connection instability) where the handshake attempt has timed out. When this happens, tlshd sends EACESS back to the kernel. However, the kernel may not be expecting this error in the context of some NFS operations, for example: writeback. It can handle ETIMEDOUT, and we would like the kernel to perform its normal hard/soft retry routines for this case to re-connect to the server. Add an error switch that clearly denotes the error paths we'd like to send back to the kernel. For SUNRPC, there are other insteresting errors that might be included (see call_conenct_status() in net/sunrpc/clnt.c), but are ommitted here because we don't have evidence of them in the wild Signed-off-by: Benjamin Coddington <[email protected]>
1 parent a636be6 commit a8bc823

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tlshd/handshake.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,14 @@ void tlshd_start_tls_handshake(gnutls_session_t session,
9494
case GNUTLS_E_CERTIFICATE_VERIFICATION_ERROR:
9595
tlshd_log_cert_verification_error(session);
9696
break;
97-
default:
97+
case -ETIMEDOUT:
9898
tlshd_log_gnutls_error(ret);
99+
parms->session_status = -ret;
100+
break;
101+
default:
102+
tlshd_log_notice("tlshd_start_tls_handshake unhandled error %d, returning EACCES\n", ret);
103+
parms->session_status = EACCES;
99104
}
100-
parms->session_status = EACCES;
101105
return;
102106
}
103107

0 commit comments

Comments
 (0)