1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
From 4d73e25a18a0d6168a6fa00a69560da9a1a7a1ab Mon Sep 17 00:00:00 2001
From: Cory Fields <cory-nospam-@coryfields.com>
Date: Thu, 13 Jun 2024 13:25:37 +0000
Subject: [PATCH] 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.
```
Backport of core#30283.
Test Plan:
ninja
---
src/mapport.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/mapport.cpp b/src/mapport.cpp
index 47881a5bb5..3d7cca8347 100644
--- a/src/mapport.cpp
+++ b/src/mapport.cpp
@@ -188,8 +188,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];
--
2.45.2
|