Commit 171456c6 authored by Matt Johnston's avatar Matt Johnston
Browse files

Avoid busy loop while waiting for rekey response

parent 2c73fd6f
...@@ -550,10 +550,12 @@ static void update_timeout(long limit, long now, long last_event, long * timeout ...@@ -550,10 +550,12 @@ static void update_timeout(long limit, long now, long last_event, long * timeout
static long select_timeout() { static long select_timeout() {
/* determine the minimum timeout that might be required, so /* determine the minimum timeout that might be required, so
as to avoid waking when unneccessary */ as to avoid waking when unneccessary */
long timeout = LONG_MAX; long timeout = KEX_REKEY_TIMEOUT;
long now = monotonic_now(); long now = monotonic_now();
update_timeout(KEX_REKEY_TIMEOUT, now, ses.kexstate.lastkextime, &timeout); if (!ses.kexstate.sentkexinit) {
update_timeout(KEX_REKEY_TIMEOUT, now, ses.kexstate.lastkextime, &timeout);
}
if (ses.authstate.authdone != 1 && IS_DROPBEAR_SERVER) { if (ses.authstate.authdone != 1 && IS_DROPBEAR_SERVER) {
/* AUTH_TIMEOUT is only relevant before authdone */ /* AUTH_TIMEOUT is only relevant before authdone */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment