From e437e383148b11197ff587e365371b1a61cb582f Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Sat, 5 Mar 2016 09:05:35 +0100 Subject: [PATCH] UPnP: check API version --- toxcore/network.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/toxcore/network.c b/toxcore/network.c index 62e4894c..f4051267 100644 --- a/toxcore/network.c +++ b/toxcore/network.c @@ -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);