summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-01-18 23:06:37 +0100
committerChristian Breunig <christian@breunig.cc>2025-01-19 00:17:12 +0100
commitf01c4d0173bb49bfd5bd4f1ef5675cc8c597595a (patch)
tree1ac0efe90ec3ee1f25c9f01a6623e9e7fec40a36 /python
parentc4c35d3b7a9de76802663376b82c7decfc878980 (diff)
downloadvyos-1x-f01c4d0173bb49bfd5bd4f1ef5675cc8c597595a.tar.gz
vyos-1x-f01c4d0173bb49bfd5bd4f1ef5675cc8c597595a.zip
wireguard: T4930: add mnemonic for WIREGUARD_REKEY_AFTER_TIME
WireGuard performs a handshake every WIREGUARD_REKEY_AFTER_TIME if data is being transmitted between the peers. If no data is transmitted, the handshake will not be initiated unless new data begins to flow. Each handshake generates a new session key, and the key is rotated at least every 120 seconds or upon data transmission after a prolonged silence.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/utils/kernel.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/vyos/utils/kernel.py b/python/vyos/utils/kernel.py
index 847f80108..05eac8a6a 100644
--- a/python/vyos/utils/kernel.py
+++ b/python/vyos/utils/kernel.py
@@ -15,6 +15,10 @@
import os
+# A list of used Kernel constants
+# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/wireguard/messages.h?h=linux-6.6.y#n45
+WIREGUARD_REKEY_AFTER_TIME = 120
+
def check_kmod(k_mod):
""" Common utility function to load required kernel modules on demand """
from vyos import ConfigError