Skip to content

Commit

Permalink
fix Mac build by adding support for libminiupnpc 2.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
nschimme authored and nobody committed Nov 19, 2024
1 parent cfe1d39 commit 1ed1ac2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/pandoragroup/GroupPortMapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class MiniUPnPcPortMapper final : public GroupPortMapper::Pimpl
UPNPUrls urls;
IGDdatas igdData;
char lanAddress[64];
char wanAddress[64];
int validIGDState = 0;

public:
Expand All @@ -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";
Expand Down

0 comments on commit 1ed1ac2

Please sign in to comment.