From 102ea404b6ee0099c43e8058366b19ce92c4e4c7 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Thu, 18 Sep 2025 23:21:53 +0200
Subject: [PATCH 6/6] add support for miniupnpc 2.2.8

---
 osdep/PortMapper.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

--- a/osdep/PortMapper.cpp
+++ b/osdep/PortMapper.cpp
@@ -222,7 +222,13 @@ class PortMapperImpl {
 					OSUtils::ztsnprintf(inport, sizeof(inport), "%d", localPort);
 
 					int foundValidIGD = 0;
+
+#if MINIUPNPC_API_VERSION < 18
 					if ((foundValidIGD = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr))) && (lanaddr[0])) {
+#else
+					if ((foundValidIGD = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), NULL, 0)) && (lanaddr[0])) {
+#endif
+
 #ifdef ZT_PORTMAPPER_TRACE
 						PM_TRACE("PortMapper: UPnP: my LAN IP address: %s" ZT_EOL_S, lanaddr);
 #endif
