aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/messages.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/messages.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 '')
-rw-r--r--src/messages.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/messages.h b/src/messages.h
index f3d47ef..2983af0 100644
--- a/src/messages.h
+++ b/src/messages.h
@@ -27,8 +27,8 @@ enum noise_lengths {
#define noise_encrypted_len(plain_len) (plain_len + NOISE_AUTHTAG_LEN)
enum cookie_values {
- COOKIE_SECRET_MAX_AGE = 2 * 60 * HZ,
- COOKIE_SECRET_LATENCY = 5 * HZ,
+ COOKIE_SECRET_MAX_AGE = 2 * 60,
+ COOKIE_SECRET_LATENCY = 5,
COOKIE_NONCE_LEN = XCHACHA20POLY1305_NONCELEN,
COOKIE_LEN = 16
};
@@ -42,14 +42,14 @@ enum counter_values {
enum limits {
REKEY_AFTER_MESSAGES = U64_MAX - 0xffff,
REJECT_AFTER_MESSAGES = U64_MAX - COUNTER_WINDOW_SIZE - 1,
- REKEY_TIMEOUT = 5 * HZ,
- REKEY_TIMEOUT_JITTER_MAX = HZ / 3,
- REKEY_AFTER_TIME = 120 * HZ,
- REJECT_AFTER_TIME = 180 * HZ,
- INITIATIONS_PER_SECOND = HZ / 50,
+ REKEY_TIMEOUT = 5,
+ REKEY_TIMEOUT_JITTER_MAX_JIFFIES = HZ / 3,
+ REKEY_AFTER_TIME = 120,
+ REJECT_AFTER_TIME = 180,
+ INITIATIONS_PER_SECOND = 50,
MAX_PEERS_PER_DEVICE = 1U << 20,
- KEEPALIVE_TIMEOUT = 10 * HZ,
- MAX_TIMER_HANDSHAKES = (90 * HZ) / REKEY_TIMEOUT,
+ KEEPALIVE_TIMEOUT = 10,
+ MAX_TIMER_HANDSHAKES = 90 / REKEY_TIMEOUT,
MAX_QUEUED_INCOMING_HANDSHAKES = 4096, /* TODO: replace this with DQL */
MAX_STAGED_PACKETS = 128,
MAX_QUEUED_PACKETS = 1024 /* TODO: replace this with DQL */