miniupnpc api_version>=14 requires ttl arg
@@ -1169,9 +1169,16 @@ void ThreadMapPort2(void* parg)
/* miniupnpc 1.5 */
devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0);
#else
- /* miniupnpc 1.6 */
+ #if MINIUPNPC_API_VERSION >= 14
+ /* miniupnpc API_VERSION 14 and above requires ttl as arg */
+ int error = 0;
+ devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, 2, &error);
+ #else
+ /* miniupnpc 1.6 and above */
int error = 0;
- devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, 255, &error);
+ devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error);
+ #endif
+
#endif
struct UPNPUrls urls;
