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 dc7a704d2..e29b069c9 100644 --- a/sshconnect.c +++ b/sshconnect.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect.c,v 1.287 2017/09/14 04:32:21 djm Exp $ */ | 1 | /* $OpenBSD: sshconnect.c,v 1.288 2017/11/25 06:46:22 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -344,7 +344,7 @@ waitrfd(int fd, int *timeoutp) | |||
344 | struct timeval t_start; | 344 | struct timeval t_start; |
345 | int oerrno, r; | 345 | int oerrno, r; |
346 | 346 | ||
347 | gettimeofday(&t_start, NULL); | 347 | monotime_tv(&t_start); |
348 | pfd.fd = fd; | 348 | pfd.fd = fd; |
349 | pfd.events = POLLIN; | 349 | pfd.events = POLLIN; |
350 | for (; *timeoutp >= 0;) { | 350 | for (; *timeoutp >= 0;) { |