From d4513f58630fd26eb204a9e67e9f6f7740247950 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Fri, 17 Oct 2025 16:32:47 +0200 Subject: [PATCH] fix(portmapper): use 2hours as lease duration Fixes #52 --- portmapper/src/upnp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portmapper/src/upnp.rs b/portmapper/src/upnp.rs index eec16ce3..69673282 100644 --- a/portmapper/src/upnp.rs +++ b/portmapper/src/upnp.rs @@ -16,8 +16,8 @@ pub type Gateway = aigd::Gateway; use crate::{Protocol, defaults::UPNP_SEARCH_TIMEOUT as SEARCH_TIMEOUT}; -/// Seconds we ask the router to maintain the port mapping. 0 means infinite. -const PORT_MAPPING_LEASE_DURATION_SECONDS: u32 = 0; +/// Seconds we ask the router to maintain the port mapping. Use 2 hours for now. +const PORT_MAPPING_LEASE_DURATION_SECONDS: u32 = 2 * 60 * 60; /// Tailscale uses the recommended port mapping lifetime for PMP, which is 2 hours. So we assume a /// half lifetime of 1h. See