aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/noise.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-06-23 04:20:14 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-23 06:08:37 +0200
commitd0bd6dc67d81236f66cb763c3d47dd6b5d7581a6 (patch)
tree6b3669f075d28267e50bda153a32e9b7ea9ff30b /src/noise.h
parenttools: fix misspelling of strchrnul in comment (diff)
downloadwireguard-monolithic-historical-d0bd6dc67d81236f66cb763c3d47dd6b5d7581a6.tar.xz
wireguard-monolithic-historical-d0bd6dc67d81236f66cb763c3d47dd6b5d7581a6.zip
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.
Diffstat (limited to 'src/noise.h')
-rw-r--r--src/noise.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/noise.h b/src/noise.h
index 5eb3a88..ec1a59d 100644
--- a/src/noise.h
+++ b/src/noise.h
@@ -16,7 +16,7 @@
#include <linux/atomic.h>
#include <linux/rwsem.h>
#include <linux/mutex.h>
-#include <linux/jiffies.h>
+#include <linux/ktime.h>
#include <linux/kref.h>
union noise_counter {
@@ -31,7 +31,7 @@ union noise_counter {
struct noise_symmetric_key {
u8 key[NOISE_SYMMETRIC_KEY_LEN];
union noise_counter counter;
- u64 birthdate;
+ ktime_t birthdate;
bool is_valid;
};
@@ -72,7 +72,7 @@ struct noise_handshake {
struct index_hashtable_entry entry;
enum noise_handshake_state state;
- u64 last_initiation_consumption;
+ ktime_t last_initiation_consumption;
struct noise_static_identity *static_identity;