From 94fc1a1cee09ad663f6a7f32dbf4c910ab0f3aa0 Mon Sep 17 00:00:00 2001 From: R4SAS Date: Tue, 14 Nov 2017 03:41:01 +0300 Subject: [PATCH] debian wheezy upnp fix --- daemon/UPnP.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/daemon/UPnP.cpp b/daemon/UPnP.cpp index d1a190d6..a24af559 100644 --- a/daemon/UPnP.cpp +++ b/daemon/UPnP.cpp @@ -82,8 +82,10 @@ namespace transport int nerror = 0; #if MINIUPNPC_API_VERSION >= 14 m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, 2, &nerror); -#else +#elseif MINIUPNPC_API_VERSION >= 8 m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, &nerror); +#else + m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0); #endif { // notify satrting thread @@ -155,7 +157,11 @@ namespace transport std::string strType (GetProto (address)), strPort (std::to_string (address->port)); int r; std::string strDesc; i2p::config::GetOption("upnp.name", strDesc); +#if MINIUPNPC_API_VERSION >= 8 r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0, "0"); +#else + r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0); +#endif if (r!=UPNPCOMMAND_SUCCESS) { LogPrint (eLogError, "UPnP: AddPortMapping (", m_NetworkAddr, ":", strPort, ") failed with code ", r);