diff options
| author | 2017-11-25 06:46:22 +0000 | |
|---|---|---|
| committer | 2017-11-25 06:46:22 +0000 | |
| commit | 04b1c7a250035d28aee67ac8e1b1ca3414231a01 (patch) | |
| tree | fda385b3b00c3495240b5f218df3b23db51dc8f2 /usr.bin/ssh/sshconnect.c | |
| parent | Remove get_current_time() and replace with calls to monotime_double() (diff) | |
| download | wireguard-openbsd-04b1c7a250035d28aee67ac8e1b1ca3414231a01.tar.xz wireguard-openbsd-04b1c7a250035d28aee67ac8e1b1ca3414231a01.zip | |
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@
Diffstat (limited to 'usr.bin/ssh/sshconnect.c')
| -rw-r--r-- | usr.bin/ssh/sshconnect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c index 4d81e7ff273..cc5c3246ef0 100644 --- a/usr.bin/ssh/sshconnect.c +++ b/usr.bin/ssh/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 @@ -332,7 +332,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;) { |
