Skip to content

Commit 8acdf66

Browse files
committed
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 9c5cdf0 commit 8acdf66

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mapport.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@ static bool ProcessUpnp()
161161
struct UPNPUrls urls;
162162
struct IGDdatas data;
163163
int r;
164-
164+
#if MINIUPNPC_API_VERSION <= 17
165165
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
166+
#else
167+
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), nullptr, 0);
168+
#endif
166169
if (r == 1)
167170
{
168171
if (fDiscover) {

0 commit comments

Comments
 (0)