Skip to content

Commit 52dfa7d

Browse files
theunihebasto
authored andcommitted
upnp: add compatibility for miniupnpc 2.2.8
See: miniupnp/miniupnp@c0a50ce The return value of 2 now indicates: "A valid connected IGD has been found but its IP address is reserved (non routable)" We continue to ignore any return value other than 1.
1 parent 84c4372 commit 52dfa7d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mapport.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,11 @@ static bool ProcessUpnp()
163163
struct UPNPUrls urls;
164164
struct IGDdatas data;
165165
int r;
166-
166+
#if MINIUPNPC_API_VERSION <= 17
167167
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
168+
#else
169+
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), nullptr, 0);
170+
#endif
168171
if (r == 1)
169172
{
170173
if (fDiscover) {

0 commit comments

Comments
 (0)