summaryrefslogtreecommitdiffhomepage
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
commitf8b3991e881a64f47412082ae15c08285eb6880b (patch)
treec5308716de6dc4765ed466e73f5bf70829f9ecfd /src/messages.h
parent66518b5ce61f74375c120a872a168585dc392ba7 (diff)
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 <Jason@zx2c4.com>
Diffstat (limited to 'src/messages.h')
-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 */