summaryrefslogtreecommitdiff
path: root/upnp.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2025-05-21 21:33:54 +0100
committerDave Hibberd <hibby@debian.org>2025-05-21 21:33:54 +0100
commit3ecb593511b18e6bd2eb768160c5a85633ab1da6 (patch)
tree0a6cb528674898a0c11953fbe766f55e1dc54164 /upnp.c
parent96197688e7b79553d45e0b6a5e760c2d80604862 (diff)
parent0d3ee7fd56efa24ba652fbc17f98dd10458e8054 (diff)
Update upstream source from tag 'upstream/6.0.24.71+repack'
Update to upstream version '6.0.24.71+repack' with Debian dir d79186aef0fff313e53c27b3f3fadf9c0193c56a
Diffstat (limited to 'upnp.c')
-rw-r--r--upnp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/upnp.c b/upnp.c
index 96cb9d3..8190a62 100644
--- a/upnp.c
+++ b/upnp.c
@@ -93,7 +93,11 @@ int i;
const char * rootdescurl = 0;
const char * multicastif = 0;
const char * minissdpdpath = 0;
+#ifdef UPNP_LOCAL_PORT_ANY
int localport = UPNP_LOCAL_PORT_ANY;
+#else
+int localport = 0;
+#endif
int retcode = 0;
int error = 0;
int ipv6 = 0;
@@ -119,8 +123,11 @@ int upnpInit()
{
if (devlist == NULL)
{
+#if MINIUPNPC_API_VERSION == 10
+ devlist = upnpDiscover(2000, multicastif, minissdpdpath, localport, ipv6, &error);
+#else
devlist = upnpDiscover(2000, multicastif, minissdpdpath, localport, ipv6, ttl, &error);
-
+#endif
if (devlist == NULL)
{
Consoleprintf("Failed to find a UPNP device");
@@ -150,8 +157,11 @@ int upnpClose()
{
if (devlist == NULL)
{
+#if MINIUPNPC_API_VERSION == 10
+ devlist = upnpDiscover(2000, multicastif, minissdpdpath, localport, ipv6, &error);
+#else
devlist = upnpDiscover(2000, multicastif, minissdpdpath, localport, ipv6, ttl, &error);
-
+#endif
if (devlist == NULL)
{
Consoleprintf("Failed to find a UPNP device");