summaryrefslogtreecommitdiffhomepage
path: root/src/peer.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-11-22 16:49:56 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-11-22 18:32:48 +0100
commit741f76cdb3f321edce92a316501fe54f52d87ba1 (patch)
treea2050de08475e7693bc9ff4c249a012165d8c481 /src/peer.h
parente79be273d702b198c1718a6189fa752e28fd4c03 (diff)
global: switch from timeval to timespec
This gets us nanoseconds instead of microseconds, which is better, and we can do this pretty much without freaking out existing userspace, which doesn't actually make use of the nano/micro seconds field: zx2c4@thinkpad ~ $ cat a.c void main() { puts(sizeof(struct timeval) == sizeof(struct timespec) ? "success" : "failure"); } zx2c4@thinkpad ~ $ gcc a.c -m64 && ./a.out success zx2c4@thinkpad ~ $ gcc a.c -m32 && ./a.out success This doesn't solve y2038 problem, but timespec64 isn't yet a thing in userspace. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/peer.h')
-rw-r--r--src/peer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/peer.h b/src/peer.h
index 49784d1..1e3c1ae 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -49,7 +49,7 @@ struct wireguard_peer {
unsigned int timer_handshake_attempts;
unsigned long persistent_keepalive_interval;
bool timers_enabled, timer_need_another_keepalive, sent_lastminute_handshake;
- struct timeval walltime_last_handshake;
+ struct timespec walltime_last_handshake;
struct kref refcount;
struct rcu_head rcu;
struct list_head peer_list;