summaryrefslogtreecommitdiff
path: root/net-p2p/monero/files/monero-0.18.3.3-upnp-add-support-for-miniupnpc-API-version-18.patch
blob: 9bd84b7444fb8160ba65c044b41a28659b921c1b (plain) (blame)
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
43
44
From 7a6f6a175183880f0045b301af5c6ada2d416734 Mon Sep 17 00:00:00 2001
From: Bertrand Jacquin <bertrand@jacquin.bzh>
Date: Wed, 17 Jul 2024 20:05:38 +0100
Subject: [PATCH] upnp: add support for miniupnpc API version 18

miniupnpc 2.2.8 updated API to version 18, with breaking change to
UPNP_GetValidIGD().

See: https://github.com/miniupnp/miniupnp/commit/c0a50ce33e3b99ce8a96fd43049bb5b53ffac62f
See: http://miniupnp.free.fr/files/changelog.php?file=miniupnpc-2.2.8.tar.gz
---
 src/p2p/net_node.inl | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 0528e0bc7988..64772f2b1144 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -2989,7 +2989,12 @@ namespace nodetool
     UPNPUrls urls;
     IGDdatas igdData;
     char lanAddress[64];
+#if MINIUPNPC_API_VERSION < 18
     result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress);
+#else
+    char wanAddress[64];
+    result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof wanAddress);
+#endif
     freeUPNPDevlist(deviceList);
     if (result > 0) {
       if (result == 1) {
@@ -3057,7 +3062,12 @@ namespace nodetool
     UPNPUrls urls;
     IGDdatas igdData;
     char lanAddress[64];
+#if MINIUPNPC_API_VERSION < 18
     result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress);
+#else
+    char wanAddress[64];
+    result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof wanAddress);
+#endif
     freeUPNPDevlist(deviceList);
     if (result > 0) {
       if (result == 1) {