From a13ba7102a1a66b627a5c717b2e0d5435f75c842 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 10 Nov 2015 17:45:05 -0800 Subject: GitHub issue #242 -- crappy uPnP protocol demands infinite lease time or else --- osdep/UPNPClient.cpp | 2 +- osdep/UPNPClient.hpp | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/osdep/UPNPClient.cpp b/osdep/UPNPClient.cpp index ceecb3a3..3193f507 100644 --- a/osdep/UPNPClient.cpp +++ b/osdep/UPNPClient.cpp @@ -115,7 +115,7 @@ public: Utils::snprintf(outport,sizeof(outport),"%u",tryPort); int mapResult = 0; - if ((mapResult = UPNP_AddPortMapping(urls.controlURL,data.first.servicetype,outport,inport,lanaddr,"ZeroTier","UDP",(const char *)0,ZT_UPNP_LEASE_DURATION)) == UPNPCOMMAND_SUCCESS) { + if ((mapResult = UPNP_AddPortMapping(urls.controlURL,data.first.servicetype,outport,inport,lanaddr,"ZeroTier","UDP",(const char *)0,"0")) == UPNPCOMMAND_SUCCESS) { #ifdef ZT_UPNP_TRACE fprintf(stderr,"UPNPClient: reserved external port: %s"ZT_EOL_S,outport); #endif diff --git a/osdep/UPNPClient.hpp b/osdep/UPNPClient.hpp index 28b9979d..a6b05b5f 100644 --- a/osdep/UPNPClient.hpp +++ b/osdep/UPNPClient.hpp @@ -42,11 +42,6 @@ */ #define ZT_UPNP_CLIENT_REFRESH_DELAY 600000 -/** - * UPNP lease duration in seconds (as string) - */ -#define ZT_UPNP_LEASE_DURATION "3600" - namespace ZeroTier { class UPNPClientImpl; -- cgit v1.2.3