]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wireguard-tools: increase watchdog idle timeout to 180s
authorRoberto Almeida Silva <robertoalmeidasilva1981@gmail.com>
Thu, 7 May 2026 08:01:01 +0000 (09:01 +0100)
committerRobert Marko <robimarko@gmail.com>
Tue, 12 May 2026 07:23:35 +0000 (09:23 +0200)
The current 150s watchdog timeout is too aggressive, leading to
premature hostname re-resolution on alive connections.

Even with a 25s keepalive, handshakes may not occur within the 150s window.
Increasing the timeout to 180s aligns the watchdog with WireGuard's
REJECT_AFTER_TIME constant, ensuring we only re-resolve when the connection
is truly considered dead.

Signed-off-by: Roberto Almeida Silva <robertoalmeidasilva1981@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23248
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/network/utils/wireguard-tools/files/wireguard_watchdog

index fc90f4a25b3564fb7a4cd3b464266d374c32f374..1b46e6178c4eff98b7a89cab656442f8551f9b8e 100644 (file)
@@ -53,7 +53,7 @@ check_peer_activity() {
   last_handshake=$(wg show ${iface} latest-handshakes | grep ${public_key} | awk '{print $2}')
   [ -z ${last_handshake} ] && return 0;
   idle_seconds=$(($(date +%s)-${last_handshake}))
-  [ ${idle_seconds} -lt 150 ] && return 0;
+  [ ${idle_seconds} -lt 180 ] && return 0;
   logger -t "wireguard_monitor" "${iface} endpoint ${endpoint_host}:${endpoint_port} is not responding for ${idle_seconds} seconds, trying to re-resolve hostname"
   wg set ${iface} peer ${public_key} endpoint "${endpoint_host}:${endpoint_port}"
 }