aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2024-06-13 13:25:37 +0000
committerCory Fields <cory-nospam-@coryfields.com>2024-06-18 12:24:48 +0000
commit8acdf66540834b9f9cf28f16d389e8b6a48516d5 (patch)
tree836919753b10dc36cc8371037680b92271b1a590
parent9c5cdf07f30f816cd134e2cd2dca9c27ef7067a5 (diff)
upnp: add compatibility for miniupnpc 2.2.8
See: https://github.com/miniupnp/miniupnp/commit/c0a50ce33e3b99ce8a96fd43049bb5b53ffac62f 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.
-rw-r--r--src/mapport.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mapport.cpp b/src/mapport.cpp
index 80670230c7..1920297be6 100644
--- a/src/mapport.cpp
+++ b/src/mapport.cpp
@@ -161,8 +161,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) {