Skip to content

Commit 842a5a9

Browse files
theunipsgreco
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. (cherry picked from commit 8acdf66)
1 parent bc05a7a commit 842a5a9

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
@@ -168,8 +168,11 @@ static bool ProcessUpnp()
168168
struct UPNPUrls urls;
169169
struct IGDdatas data;
170170
int r;
171-
171+
#if MINIUPNPC_API_VERSION <= 17
172172
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
173+
#else
174+
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), nullptr, 0);
175+
#endif
173176
if (r == 1)
174177
{
175178
if (fDiscover) {

0 commit comments

Comments
 (0)