diff options
author | dtucker@openbsd.org@openbsd.org <dtucker@openbsd.org@openbsd.org> | 2017-11-25 06:46:22 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-11-28 12:01:49 +1100 |
commit | 5db6fbf1438b108e5df3e79a1b4de544373bc2d4 (patch) | |
tree | 95f5df8248cca30df3ab00e70e80d28410be760c /sshconnect.c | |
parent | 2d638e986085bdf1a40310ed6e2307463db96ea0 (diff) |
upstream commit
Add monotime_ts and monotime_tv that return monotonic
timespec and timeval respectively. Replace calls to gettimeofday() in packet
timing with monotime_tv so that the callers will work over a clock step.
Should prevent integer overflow during clock steps reported by wangle6 at
huawei.com. "I like" markus@
OpenBSD-Commit-ID: 74d684264814ff806f197948b87aa732cb1b0b8a
Diffstat (limited to 'sshconnect.c')
-rw-r--r-- | sshconnect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sshconnect.c b/sshconnect.c index dc7a704d..e29b069c 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect.c,v 1.287 2017/09/14 04:32:21 djm Exp $ */ +/* $OpenBSD: sshconnect.c,v 1.288 2017/11/25 06:46:22 dtucker Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -344,7 +344,7 @@ waitrfd(int fd, int *timeoutp) struct timeval t_start; int oerrno, r; - gettimeofday(&t_start, NULL); + monotime_tv(&t_start); pfd.fd = fd; pfd.events = POLLIN; for (; *timeoutp >= 0;) { |