summaryrefslogtreecommitdiffhomepage
path: root/common-session.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2016-04-29 23:04:10 +0800
committerMatt Johnston <matt@ucc.asn.au>2016-04-29 23:04:10 +0800
commit81743004297b665b8885e0bfb8c13821d673493e (patch)
treee749772cf22f43e5de14197708fc582578c78607 /common-session.c
parenta453b0616802ea82f6ea1d30b59e382dfcec377e (diff)
Avoid busy loop while waiting for rekey response
Diffstat (limited to 'common-session.c')
-rw-r--r--common-session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/common-session.c b/common-session.c
index 20b6ba3..ed96252 100644
--- a/common-session.c
+++ b/common-session.c
@@ -550,10 +550,12 @@ static void update_timeout(long limit, long now, long last_event, long * timeout
static long select_timeout() {
/* determine the minimum timeout that might be required, so
as to avoid waking when unneccessary */
- long timeout = LONG_MAX;
+ long timeout = KEX_REKEY_TIMEOUT;
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) {
/* AUTH_TIMEOUT is only relevant before authdone */