UPnP: check API version

This commit is contained in:
Ansa89 2016-03-05 09:05:35 +01:00
parent 08be91035e
commit e437e38314

View File

@ -127,7 +127,12 @@ static void upnp_map_port(uint16_t port)
int error = 0;
struct UPNPDev *devlist = NULL;
#if MINIUPNPC_API_VERSION < 14
devlist = upnpDiscover(1000, NULL, NULL, 0, 0, &error);
#else
devlist = upnpDiscover(1000, NULL, NULL, 0, 0, 2, &error);
#endif
if (error) {
LOGGER_WARNING("UPnP discovery failed (error = %d)", error);