summaryrefslogtreecommitdiff
path: root/upnp.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2025-05-21 21:33:52 +0100
committerDave Hibberd <hibby@debian.org>2025-05-21 21:33:52 +0100
commit0d3ee7fd56efa24ba652fbc17f98dd10458e8054 (patch)
tree3ee81c17c041f6aeba3492c805c11ed0192839dc /upnp.c
parent96197688e7b79553d45e0b6a5e760c2d80604862 (diff)
New upstream version 6.0.24.71+repackupstream/6.0.24.71+repack
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");