From 5da85a1fb26587695795c7562447dd30ef9ed616 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 23 Oct 2018 17:11:05 -0700 Subject: [PATCH] Fix malformed UPnP lease duration --- miss/miss.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miss/miss.cpp b/miss/miss.cpp index a8a929c..757d407 100644 --- a/miss/miss.cpp +++ b/miss/miss.cpp @@ -25,7 +25,6 @@ #include #define NL "\n" -#define STR(x) #x #define SERVICE_NAME "MISS" #define UPNP_SERVICE_NAME "Moonlight" @@ -149,10 +148,11 @@ bool UPnPMapPort(struct UPNPUrls* urls, struct IGDdatas* data, int proto, const } // Create or update the expiration time of an existing mapping + snprintf(leaseDuration, sizeof(leaseDuration), "%d", PORT_MAPPING_DURATION_SEC); printf("Updating UPnP port mapping for %s %s -> %s...", protoStr, portStr, myAddr); err = UPNP_AddPortMapping( urls->controlURL, data->first.servicetype, portStr, - portStr, myAddr, myDesc, protoStr, nullptr, STR(PORT_MAPPING_DURATION_SEC)); + portStr, myAddr, myDesc, protoStr, nullptr, leaseDuration); if (err == 725) { // OnlyPermanentLeasesSupported err = UPNP_AddPortMapping( urls->controlURL, data->first.servicetype, portStr,