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 Fuzzbawls committed Sep 24, 2024
1 parent b507683 commit 4fffec0
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 @@ -166,8 +166,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) {
char externalIPAddress[40];
Expand Down

0 comments on commit 4fffec0

Please sign in to comment.