Skip to content

Commit

Permalink
upnp: add compatibility for miniupnpc 2.2.8
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
theuni authored and hebasto committed Sep 27, 2024
1 parent 84c4372 commit 52dfa7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mapport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ static bool ProcessUpnp()
struct UPNPUrls urls;
struct IGDdatas data;
int r;

#if MINIUPNPC_API_VERSION <= 17
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
#else
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), nullptr, 0);
#endif
if (r == 1)
{
if (fDiscover) {
Expand Down

0 comments on commit 52dfa7d

Please sign in to comment.