summaryrefslogtreecommitdiff
path: root/misc.h
diff options
context:
space:
mode:
authordtucker@openbsd.org@openbsd.org <dtucker@openbsd.org@openbsd.org>2017-11-25 06:46:22 +0000
committerDamien Miller <djm@mindrot.org>2017-11-28 12:01:49 +1100
commit5db6fbf1438b108e5df3e79a1b4de544373bc2d4 (patch)
tree95f5df8248cca30df3ab00e70e80d28410be760c /misc.h
parent2d638e986085bdf1a40310ed6e2307463db96ea0 (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 'misc.h')
-rw-r--r--misc.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/misc.h b/misc.h
index 5ad30ce3..4fa029a2 100644
--- a/misc.h
+++ b/misc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.h,v 1.67 2017/10/25 00:17:08 djm Exp $ */
+/* $OpenBSD: misc.h,v 1.68 2017/11/25 06:46:22 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -67,6 +67,8 @@ char *tohex(const void *, size_t);
void sanitise_stdfd(void);
void ms_subtract_diff(struct timeval *, int *);
void ms_to_timeval(struct timeval *, int);
+void monotime_ts(struct timespec *);
+void monotime_tv(struct timeval *);
time_t monotime(void);
double monotime_double(void);
void lowercase(char *s);