Skip to content

Commit c9f2f81

Browse files
fix(portmapper): UPNP use 2hours as lease duration
Fixes #52
1 parent f71dd22 commit c9f2f81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

portmapper/src/upnp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ pub type Gateway = aigd::Gateway<aigd::tokio::Tokio>;
1616

1717
use crate::{Protocol, defaults::UPNP_SEARCH_TIMEOUT as SEARCH_TIMEOUT};
1818

19-
/// Seconds we ask the router to maintain the port mapping. 0 means infinite.
20-
const PORT_MAPPING_LEASE_DURATION_SECONDS: u32 = 0;
19+
/// Seconds we ask the router to maintain the port mapping. Use 2 hours for now.
20+
const PORT_MAPPING_LEASE_DURATION_SECONDS: u32 = 2 * 60 * 60;
2121

2222
/// Tailscale uses the recommended port mapping lifetime for PMP, which is 2 hours. So we assume a
2323
/// half lifetime of 1h. See <https://datatracker.ietf.org/doc/html/rfc6886#section-3.3>

0 commit comments

Comments
 (0)