upnp: add support for miniupnpc API version 18

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

See: c0a50ce33e
See: http://miniupnp.free.fr/files/changelog.php?file=miniupnpc-2.2.8.tar.gz
This commit is contained in:
Bertrand Jacquin 2024-07-17 20:05:38 +01:00
parent caa62bc9ea
commit 2d885033d2
No known key found for this signature in database
GPG Key ID: 5534871F2E2E93DA

View File

@ -2985,7 +2985,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) {
@ -3053,7 +3058,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) {