From f8b3991e881a64f47412082ae15c08285eb6880b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 23 Jun 2018 04:20:14 +0200 Subject: global: use ktime boottime instead of jiffies Since this is a network protocol, expirations need to be accounted for, even across system suspend. On real systems, this isn't a problem, since we're clearing all keys before suspend. But on Android, where we don't do that, this is something of a problem. So, we switch to using boottime instead of jiffies. Signed-off-by: Jason A. Donenfeld --- src/cookie.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cookie.h') diff --git a/src/cookie.h b/src/cookie.h index 9f519ef..e83c256 100644 --- a/src/cookie.h +++ b/src/cookie.h @@ -15,13 +15,13 @@ struct cookie_checker { u8 secret[NOISE_HASH_LEN]; u8 cookie_encryption_key[NOISE_SYMMETRIC_KEY_LEN]; u8 message_mac1_key[NOISE_SYMMETRIC_KEY_LEN]; - u64 secret_birthdate; + ktime_t secret_birthdate; struct rw_semaphore secret_lock; struct wireguard_device *device; }; struct cookie { - u64 birthdate; + ktime_t birthdate; bool is_valid; u8 cookie[COOKIE_LEN]; bool have_sent_mac1; -- cgit v1.2.3-59-g8ed1b