diff --git a/src/pandoragroup/GroupPortMapper.cpp b/src/pandoragroup/GroupPortMapper.cpp index 074b1fed..7f611fd4 100644 --- a/src/pandoragroup/GroupPortMapper.cpp +++ b/src/pandoragroup/GroupPortMapper.cpp @@ -62,6 +62,7 @@ class MiniUPnPcPortMapper final : public GroupPortMapper::Pimpl UPNPUrls urls; IGDdatas igdData; char lanAddress[64]; + char wanAddress[64]; int validIGDState = 0; public: @@ -75,11 +76,21 @@ class MiniUPnPcPortMapper final : public GroupPortMapper::Pimpl deviceList = UPNPDev_ptr(upnpDiscover(1000, nullptr, nullptr, 0, 0, 2, &result), ::freeUPNPDevlist); #endif +#if MINIUPNPC_API_VERSION < 18 validIGDState = UPNP_GetValidIGD(deviceList.get(), &urls, &igdData, lanAddress, sizeof lanAddress); +#else + validIGDState = UPNP_GetValidIGD(deviceList.get(), + &urls, + &igdData, + lanAddress, + sizeof lanAddress, + wanAddress, + sizeof wanAddress); +#endif switch (validIGDState) { case 0: qInfo() << "No IGD found";