[vlc-commits] [Git][videolan/vlc][3.0.x] 9 commits: upnp: remove pointless `#if` guards

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu May 5 10:54:23 UTC 2022



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
75bb776c by Alaric Senat at 2022-05-05T09:30:43+00:00
upnp: remove pointless `#if` guards

These functions are inline and will be removed by the compiler anyway if
unused. The #if guards add unecessary compexity.

(cherry picked from commit aaef25ce7a747f14878c80a415194389c4c24e92)

- - - - -
de9c8cde by Alaric Senat at 2022-05-05T09:30:43+00:00
upnp: prioritize `UpnpInit2()` over `UpnpInit()`

`UpnpInit` is deprecated since 1.8.3 and removed in 1.14. `UpnpInit2`
offer a better replacement, working for both ipv6 and ipv4. There is no
reason to keep using `UpnpInit` apart from keeping the module usable
with 1.6.

- - - - -
5c7ba52a by Alaric Senat at 2022-05-05T09:30:43+00:00
contrib: upnp: remove unapplied winrt patch

This patch was never used.

(cherry picked from commit cf47ddcc7472b13d3168e5d39ea0e120f54c4ed6)

- - - - -
43a5df25 by Marvin Scholz at 2022-05-05T09:30:43+00:00
contrib: upnp: Remove mingw ipv6 patch

VLC needs Mingw-w64 v5.0 or higher , the define mentioned in the patch
was added in v3.0.0

(cherry picked from commit 6b94b96754978787e62dc2ffee6469efbd62ae06)

- - - - -
9d223a21 by Alaric Senat at 2022-05-05T09:30:43+00:00
extra: snap: build libupnp from contribs

We will soon bump libupnp to a more recent version fixing
vulnerabilities for libupnp >= 1.8.3.
It might be preferable to switch to the contribs version of libupnp also
for snapcraft as our snap repo is still using `core18` which only
provides libupnp 1.6.

- - - - -
9419aec1 by Alaric Senat at 2022-05-05T09:30:43+00:00
contrib: upnp: update to 1.14.11

libupnp 1.6 is starting to get really old and caused bugs recently with
the new winpthread rework for contribs.

Added contrib patches:
  - revert-ifaddrs.patch (revert changes breaking android)

Removed contrib patches:
  - 0001-Do-not-try[...]           -> Fixed upstream by 386b7ed7
  - dont_use_down_intf.patch       -> Fixed upstream by 1f2e3b88
  - fix_infinite_loop.patch        -> Fixed upstream by 4367cbfa
  - libpthread.patch               -> Replaced
  - missing_win32.patch            -> Fixed upstream by 02bb90c5
  - no-getifinfo.patch             -> Fixed upstream by 0296c3cd
  - use-inet-pton.patch            -> Fixed upstream by 44cdeeb7
  - use-unicode.patch              -> Fixed upstream
  - windows-random.patch           -> Fixed upstream by 44e092a6

Edited patches (mostly to fit the new sources):
  - miniserver.patch
  - upnp-no-debugfile.patch
  - pthread-w32-checks.patch (Partially fixed upstream by e0f44dd9)
  - libupnp-win32.patch (Partially fixed upstream)
  - libupnp-win64.patch (Partially fixed upstream by 421d5d28)
  - windows-version-inet.patch
  - libupnp-win32-exports.patch

Renamed patch:
  - pthread-w32-force -> pthread-force (Gets applied to linux too now)

(cherry picked from commit 4b31cb6942ded95baff1da10a238f7c4c0bbc18e)

- - - - -
a9bfd4e5 by Alaric Senat at 2022-05-05T09:30:43+00:00
contrib: upnp: unify `CONFIGURE_ARGS`

(cherry picked from commit cb610b5bfa2b2a172d5524bf07d8132b90f53489)

- - - - -
a0db8719 by Alaric Senat at 2022-05-05T09:30:43+00:00
contrib: upnp: rename config options variable

Adding the `UPNP_` prefix just like the other variables will avoid
potential namespaces conflicts.

(cherry picked from commit 48cf701329bb3f95c5f8ef0a5d0c9494f4020d37)

- - - - -
2baf4b09 by Alaric Senat at 2022-05-05T09:30:43+00:00
contrib: upnp: remove `--without-documentation`

This configure flag was dropped in 1.8.
See pupnp upstream 8abbd63b9a8190bcbbbbcbcff5cdbaaf83fbe99a

(cherry picked from commit 5f20a2b4bce759c0cf207dcff6897604a93e683c)

- - - - -


23 changed files:

- − contrib/src/upnp/0001-Do-not-try-to-detach-detached-thread-the-result-is-u.patch
- contrib/src/upnp/SHA512SUMS
- − contrib/src/upnp/dont_use_down_intf.patch
- − contrib/src/upnp/fix_infinite_loop.patch
- − contrib/src/upnp/libpthread.patch
- − contrib/src/upnp/libupnp-ipv6.patch
- contrib/src/upnp/libupnp-pthread-w32-force.patch → contrib/src/upnp/libupnp-pthread-force.patch
- − contrib/src/upnp/libupnp-pthread-w32-checks.patch
- contrib/src/upnp/libupnp-win32-exports.patch
- contrib/src/upnp/libupnp-win32.patch
- contrib/src/upnp/libupnp-win64.patch
- contrib/src/upnp/miniserver.patch
- − contrib/src/upnp/missing_win32.patch
- − contrib/src/upnp/no-getifinfo.patch
- + contrib/src/upnp/revert-ifaddrs.patch
- contrib/src/upnp/rules.mak
- contrib/src/upnp/upnp-no-debugfile.patch
- − contrib/src/upnp/use-unicode.patch
- − contrib/src/upnp/windows-random.patch
- contrib/src/upnp/windows-version-inet.patch
- − contrib/src/upnp/winrt-dont-force-win32-winnt.patch
- extras/package/snap/snapcraft.yaml
- modules/services_discovery/upnp.cpp


Changes:

=====================================
contrib/src/upnp/0001-Do-not-try-to-detach-detached-thread-the-result-is-u.patch deleted
=====================================
@@ -1,30 +0,0 @@
-From de5cd603acd5c81ec947fd9664817231a3d2c418 Mon Sep 17 00:00:00 2001
-From: Jean-Francois Dockes <jf at dockes.org>
-Date: Sun, 27 Jan 2019 10:44:17 +0100
-Subject: [PATCH] Do not try to detach detached thread, the result is
- undefined. Fixes issue #102
-
-(cherry picked from commit 386b7ed79146ecf7a3bba49f48cb8f41a9b49170)
----
- threadutil/src/ThreadPool.c | 5 -----
- 1 file changed, 5 deletions(-)
-
-diff --git a/threadutil/src/ThreadPool.c b/threadutil/src/ThreadPool.c
-index fcf71087..8c6cd092 100644
---- a/threadutil/src/ThreadPool.c
-+++ b/threadutil/src/ThreadPool.c
-@@ -651,11 +651,6 @@ static int CreateWorker(
- 	rc = ithread_create(&temp, &attr, WorkerThread, tp);
- 	ithread_attr_destroy(&attr);
- 	if (rc == 0) {
--		rc = ithread_detach(temp);
--		/* ithread_detach will return EINVAL if thread has been
--		 successfully detached by ithread_create */
--		if (rc == EINVAL)
--			rc = 0;
- 		tp->pendingWorkerThreadStart = 1;
- 		/* wait until the new worker thread starts */
- 		while (tp->pendingWorkerThreadStart) {
--- 
-2.27.0.windows.1
-


=====================================
contrib/src/upnp/SHA512SUMS
=====================================
@@ -1 +1 @@
-97af62a7483cc19cfe80157cbc3383c1b4b7c9c39b848f4ed063784b74df0b9b0527f7b467e01451e0a44dbf9e8a9eab510619146a6ee1e3dce46f3e4af6e661  libupnp-1.6.19.tar.bz2
+deb971c6ebaa6a159072cb4153f7ada40400d88faee896366a694d0f15cf1aeea4de1199186122a2968c9e6a92fb7687019601cdbe1f7e08d2962496469a55ea  pupnp-release-1.14.11.tar.gz


=====================================
contrib/src/upnp/dont_use_down_intf.patch deleted
=====================================
@@ -1,12 +0,0 @@
---- upnp_clean/upnp/src/api/upnpapi.c	2015-05-11 18:04:45.054340200 +0200
-+++ libupnp-1.6.19/upnp/src/api/upnpapi.c	2015-05-11 18:11:37.438360600 +0200
-@@ -3258,7 +3258,8 @@
-		ifname_found = 1;
-	}
-	for (adapts_item = adapts; adapts_item != NULL; adapts_item = adapts_item->Next) {
--		if (adapts_item->Flags & IP_ADAPTER_NO_MULTICAST) {
-+		if (adapts_item->Flags & IP_ADAPTER_NO_MULTICAST ||
-+			adapts_item->OperStatus != IfOperStatusUp) {
-			continue;
-        }
-		if (ifname_found == 0) {


=====================================
contrib/src/upnp/fix_infinite_loop.patch deleted
=====================================
@@ -1,21 +0,0 @@
---- upnp_clean/upnp/src/api/upnpapi.c	2015-05-11 17:59:17.892347500 +0200
-+++ upnp/upnp/src/api/upnpapi.c	2015-05-11 18:01:05.000083700 +0200
-@@ -3257,8 +3257,7 @@
- 		strncpy(gIF_NAME, IfName, sizeof(gIF_NAME) - 1);
- 		ifname_found = 1;
- 	}
--	adapts_item = adapts;
--	while (adapts_item != NULL) {
-+	for (adapts_item = adapts; adapts_item != NULL; adapts_item = adapts_item->Next) {
- 		if (adapts_item->Flags & IP_ADAPTER_NO_MULTICAST) {
- 			continue;
- 		}
-@@ -3345,8 +3344,6 @@
- 			gIF_INDEX = adapts_item->IfIndex;
- 			break;
- 		}
--		/* Next adapter. */
--		adapts_item = adapts_item->Next;
- 	}
- 	/* Failed to find a valid interface, or valid address. */
- 	if (ifname_found == 0 || valid_addr_found == 0) {


=====================================
contrib/src/upnp/libpthread.patch deleted
=====================================
@@ -1,15 +0,0 @@
-On GNU/Linux, -pthread does not work properly when linking a static
-library that depends on POSIX threads. -lpthread must be checked first.
-
-diff -Nru upnp.orig/m4/acx_pthread.m4 upnp/m4/acx_pthread.m4
---- upnp.orig/m4/acx_pthread.m4	2016-08-06 11:54:20.990800226 +0300
-+++ upnp/m4/acx_pthread.m4	2016-08-06 11:54:37.909800395 +0300
-@@ -123,7 +123,7 @@
- # which indicates that we try without any flags at all, and "pthread-config"
- # which is a program returning the flags for the Pth emulation library.
- 
--acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
-+acx_pthread_flags="pthreads none -Kthread -kthread lthread -lpthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
- 
- # The ordering *is* (sometimes) important.  Some notes on the
- # individual items follow:


=====================================
contrib/src/upnp/libupnp-ipv6.patch deleted
=====================================
@@ -1,49 +0,0 @@
-From 438ace99538713fb1370411188e0f370069a1818 Mon Sep 17 00:00:00 2001
-From: Konstantin Pavlov <thresh at videolan.org>
-Date: Tue, 29 May 2012 10:18:40 +0400
-Subject: [PATCH] Fix compile under mingw with IPv6 enabled.
-
----
- upnp/src/genlib/miniserver/miniserver.c |    7 +++++++
- upnp/src/ssdp/ssdp_server.c             |    7 +++++++
- 2 files changed, 14 insertions(+)
-
-diff --git a/upnp/src/genlib/miniserver/miniserver.c b/upnp/src/genlib/miniserver/miniserver.c
-index af310ca..1ae422f 100644
---- a/upnp/src/genlib/miniserver/miniserver.c
-+++ b/upnp/src/genlib/miniserver/miniserver.c
-@@ -68,6 +68,13 @@
- /*! . */
- #define APPLICATION_LISTENING_PORT 49152
- 
-+/* IPV6_V6ONLY is missing from MinGW, hack taken from
-+ * http://svn.apache.org/repos/asf/apr/apr/trunk/network_io/win32/sockopt.c
-+ */
-+#ifndef IPV6_V6ONLY
-+#define IPV6_V6ONLY 27
-+#endif
-+
- struct mserv_request_t {
- 	/*! Connection handle. */
- 	SOCKET connfd;
-diff --git a/upnp/src/ssdp/ssdp_server.c b/upnp/src/ssdp/ssdp_server.c
-index 231c2c5..6a9c27f 100644
---- a/upnp/src/ssdp/ssdp_server.c
-+++ b/upnp/src/ssdp/ssdp_server.c
-@@ -69,6 +69,13 @@
- 	#endif /* UPNP_ENABLE_IPV6 */
- #endif /* INCLUDE_CLIENT_APIS */
- 
-+/* IPV6_V6ONLY is missing from MinGW, hack taken from
-+ * http://svn.apache.org/repos/asf/apr/apr/trunk/network_io/win32/sockopt.c
-+ */
-+#ifndef IPV6_V6ONLY
-+#define IPV6_V6ONLY 27
-+#endif
-+
- void RequestHandler();
- 
- enum Listener {
--- 
-1.7.9.7
-


=====================================
contrib/src/upnp/libupnp-pthread-w32-force.patch → contrib/src/upnp/libupnp-pthread-force.patch
=====================================
@@ -4,7 +4,7 @@
  #
  # Update environment variables for pthreads
  #
-+PTHREAD_LIBS="-lpthread"
++PTHREAD_LIBS="-lpthread -pthread"
  CC="$PTHREAD_CC"
  CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
  LIBS="$PTHREAD_LIBS $LIBS"


=====================================
contrib/src/upnp/libupnp-pthread-w32-checks.patch deleted
=====================================
@@ -1,54 +0,0 @@
---- upnp/threadutil/src/ThreadPool.c.pthread-w32	2018-05-17 10:53:48.438587300 +0200
-+++ upnp/threadutil/src/ThreadPool.c	2018-05-17 10:54:03.696907300 +0200
-@@ -34,7 +34,7 @@
-  * \file
-  */
- 
--#if !defined(WIN32)
-+#if !defined(WIN32) || !defined(_MSC_VER)
- 	#include <sys/param.h>
- #endif
- 
-@@ -263,8 +263,16 @@ static int SetPolicyType(
- #elif defined(__OSX__) || defined(__APPLE__) || defined(__NetBSD__)
- 	setpriority(PRIO_PROCESS, 0, 0);
- 	retVal = 0;
--#elif defined(WIN32)
-+#elif defined(PTW32_LEVEL) 
- 	retVal = sched_setscheduler(0, in);
-+#elif defined(WIN32)
-+	struct sched_param current;
-+	int sched_result;
-+
-+	memset(&current, 0, sizeof(current));
-+	current.sched_priority = sched_get_priority_min(DEFAULT_POLICY);
-+	sched_result = sched_setscheduler(0, in, &current);
-+	retVal = (sched_result != -1 || errno == EPERM) ? 0 : errno;
- #elif defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
- 	struct sched_param current;
- 	int sched_result;
-@@ -415,11 +423,11 @@ static void SetSeed(void)
- 	struct timeval t;
-   
- 	gettimeofday(&t, NULL);
--#if defined(WIN32)
-+#if defined(PTW32_LEVEL)
- 	srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id().p);
- #elif defined(BSD) || defined(__OSX__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
- 	srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id());
--#elif defined(__linux__) || defined(__sun) || defined(__CYGWIN__) || defined(__GLIBC__)
-+#elif defined(__linux__) || defined(__sun) || defined(__CYGWIN__) || defined(__GLIBC__) || defined(WIN32)
- 	srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id());
- #else
- 	{
---- upnp/upnp/src/api/upnpdebug.c.pthread-w32	2018-05-17 10:53:05.030173700 +0200
-+++ upnp/upnp/src/api/upnpdebug.c	2018-05-17 10:53:44.686358100 +0200
-@@ -183,7 +183,7 @@ void UpnpDisplayFileAndLine(FILE *fd, co
- 		lines[i] = buf[i];
- 	/* Put the debug lines in the buffer */
- 	sprintf(buf[0], "DEBUG - THREAD ID: 0x%lX",
--#ifdef WIN32
-+#if defined(PTW32_LEVEL)
- 		(unsigned long int)ithread_self().p
- #else
- 		(unsigned long int)ithread_self()


=====================================
contrib/src/upnp/libupnp-win32-exports.patch
=====================================
@@ -1,31 +1,35 @@
---- upnp/configure.ac.win32	2013-11-15 17:18:45.000000000 +0100
-+++ upnp/configure.ac	2018-05-17 11:41:56.647083600 +0200
-@@ -670,6 +670,17 @@ ACX_PTHREAD(
+---
+ configure.ac  | 7 +++++++
+ libupnp.pc.in | 2 +-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 35c060cc..76f48486 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -509,6 +509,13 @@ AX_PTHREAD(
  CC="$PTHREAD_CC"
  CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
  LIBS="$PTHREAD_LIBS $LIBS"
 +
-+PC_CFLAGS="$PTHREAD_CFLAGS"
-+
 +# WIN32 specific
 +if test "$ac_cv_win32" = "yes"; then
 +WIN32_LIBS="-liphlpapi -lws2_32"
-+PC_CFLAGS="$PC_CFLAGS -DUPNP_STATIC_LIB"
 +fi
-+AC_SUBST(PC_CFLAGS)
 +AC_SUBST(WIN32_LIBS)
 +
  #
  # Determine if pthread_rwlock_t is available
  #
---- upnp/libupnp.pc.in.win32	2010-12-23 21:24:05.000000000 +0100
-+++ upnp/libupnp.pc.in	2018-05-17 11:43:06.014745400 +0200
-@@ -6,6 +6,6 @@ includedir=@includedir@
+diff --git a/libupnp.pc.in b/libupnp.pc.in
+index 8c6fc22f..ccdaf871 100644
+--- a/libupnp.pc.in
++++ b/libupnp.pc.in
+@@ -6,7 +6,7 @@ includedir=@includedir@
  Name: libupnp
  Description: Linux SDK for UPnP Devices
  Version: @VERSION@
--Libs: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ -L${libdir} -lupnp -lthreadutil -lixml 
--Cflags: @PTHREAD_CFLAGS@ -I${includedir}/upnp
-+Libs: -L${libdir} -lupnp -lthreadutil -lixml @PTHREAD_LIBS@ @WIN32_LIBS@
-+Cflags: @PC_CFLAGS@ -I${includedir}/upnp
- 
+-Libs: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ -L${libdir} -lupnp -lixml
++Libs: -L${libdir} -lupnp -lixml @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ @WIN32_LIBS@
+ Libs.private: @OPENSSL_LIBS@
+ Cflags: @PTHREAD_CFLAGS@ -I${includedir}/upnp


=====================================
contrib/src/upnp/libupnp-win32.patch
=====================================
@@ -9,17 +9,3 @@
  	#else
  		#define max(a, b)   (((a)>(b))? (a):(b))
  		#define min(a, b)   (((a)<(b))? (a):(b))
---- upnp/upnp/inc/UpnpInet.h	2011-04-03 04:50:36.000000000 +0200
-+++ upnp.neww/upnp/inc/UpnpInet.h	2011-11-18 01:54:45.418529337 +0100
-@@ -15,11 +15,6 @@
- 
- #ifdef WIN32
- 	#include <stdarg.h>
--	#ifndef UPNP_USE_MSVCPP
--		/* Removed: not required (and cause compilation issues) */
--		#include <winbase.h>
--		#include <windef.h>
--	#endif
- 	#include <winsock2.h>
- 	#include <iphlpapi.h>
- 	#include <ws2tcpip.h>


=====================================
contrib/src/upnp/libupnp-win64.patch
=====================================
@@ -1,41 +1,36 @@
---- libupnp/threadutil/inc/ThreadPool.h	2011-01-20 07:46:57.000000000 +0100
-+++ libupnp.new/threadutil/inc/ThreadPool.h	2011-09-23 01:36:12.000000000 +0200
-@@ -45,6 +45,7 @@
- #include <errno.h>
+From 9ec9967c55e51c387f7d517e72adb6ed278d153f Mon Sep 17 00:00:00 2001
+From: Alaric Senat <dev.asenat at posteo.net>
+Date: Wed, 10 Mar 2021 15:25:20 +0100
+Subject: win64
 
- #ifdef WIN32
-+	#ifndef _TIMEZONE_DEFINED
- 	#include <time.h>
- 	struct timezone
- 	{
-@@ -52,6 +53,7 @@
- 		int  tz_dsttime;     /* type of dst correction */
- 	};
- 	int gettimeofday(struct timeval *tv, struct timezone *tz);
-+	#endif
- #else /* WIN32 */
- 	#include <sys/param.h>
- 	#include <sys/time.h> /* for gettimeofday() */
---- libupnp-1.6.16/upnp/inc/upnp.h.orig	2012-03-22 00:15:38.000000000 +0100
-+++ libupnp-1.6.16/upnp/inc/upnp.h	2012-03-28 18:58:55.043642000 +0200
-@@ -61,6 +61,20 @@
+---
+ upnp/inc/upnp.h | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/upnp/inc/upnp.h b/upnp/inc/upnp.h
+index 0a51b34..4711e11 100644
+--- a/upnp/inc/upnp.h
++++ b/upnp/inc/upnp.h
+@@ -61,6 +61,19 @@
  	/* Other systems ??? */
  #endif
  
-+#   if defined( __MINGW32__ )
-+#       if !defined( _OFF_T_ )
-+            typedef long long _off_t;
-+            typedef _off_t off_t;
-+#           define _OFF_T_
-+#       else
-+#           ifdef off_t
-+#               undef off_t
-+#           endif
-+#           define off_t long long
-+#       endif
-+#   endif
-+
++#if defined(__MINGW32__)
++	#if !defined(_OFF_T_)
++   typedef long long _off_t;
++   typedef _off_t off_t;
++		#define _OFF_T_
++	#else
++		#ifdef off_t
++			#undef off_t
++		#endif
++		#define off_t long long
++	#endif
++#endif
 +
- #define LINE_SIZE  (size_t)180
- #define NAME_SIZE  (size_t)256
- #define MNFT_NAME_SIZE  64
+ #ifdef UPNP_ENABLE_OPEN_SSL
+ 	#include <openssl/ssl.h>
+ #endif
+-- 
+2.29.2
+


=====================================
contrib/src/upnp/miniserver.patch
=====================================
@@ -1,17 +1,31 @@
---- upnp/upnp/src/api/upnpapi.c.orig	2013-04-08 00:23:46.000000000 +0200
-+++ upnp/upnp/src/api/upnpapi.c	2013-04-08 00:25:49.000000000 +0200
-@@ -358,13 +358,13 @@
+From e238e20db9153d4a066cbcce1fdb5f95ada45fbf Mon Sep 17 00:00:00 2001
+From: Alaric Senat <dev.asenat at posteo.net>
+Date: Wed, 10 Mar 2021 12:01:18 +0100
+Subject: miniserver
+
+---
+ upnp/src/api/upnpapi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c
+index 3ad4658..b0ee7db 100644
+--- a/upnp/src/api/upnpapi.c
++++ b/upnp/src/api/upnpapi.c
+@@ -387,13 +387,13 @@ static int UpnpInitPreamble(void)
  		return retVal;
  	}
  
 +#ifdef INTERNAL_WEB_SERVER
  #ifdef INCLUDE_DEVICE_APIS
- #if EXCLUDE_SOAP == 0
+ 	#if EXCLUDE_SOAP == 0
  	SetSoapCallback(soap_device_callback);
- #endif
+ 	#endif
  #endif /* INCLUDE_DEVICE_APIS */
  
 -#ifdef INTERNAL_WEB_SERVER
- #if EXCLUDE_GENA == 0
+ 	#if EXCLUDE_GENA == 0
  	SetGenaCallback(genaCallback);
- #endif
+ 	#endif
+-- 
+2.29.2
+


=====================================
contrib/src/upnp/missing_win32.patch deleted
=====================================
@@ -1,13 +0,0 @@
---- upnp_clean/upnp/inc/upnp.h	2015-04-30 14:37:26.962425889 +0200
-+++ upnp/upnp/inc/upnp.h	2015-04-30 14:41:48.099528162 +0200
-@@ -41,6 +41,10 @@
-  * \file
-  */
- 
-+#ifdef _WIN32
-+# define WIN32
-+#endif
-+
- #include "ixml.h"
- #include "upnpconfig.h"
- #include "UpnpGlobal.h"


=====================================
contrib/src/upnp/no-getifinfo.patch deleted
=====================================
@@ -1,18 +0,0 @@
---- upnp/upnp/src/api/upnpapi.c.orig	2016-05-10 10:39:59.757852761 +0200
-+++ upnp/upnp/src/api/upnpapi.c	2016-05-10 10:40:24.885603353 +0200
-@@ -3205,6 +3205,7 @@
- }
- 
- 
-+#ifdef UPNP_ENABLE_IPV6
- int UpnpGetIfInfo(const char *IfName)
- {
- #ifdef WIN32
-@@ -3587,6 +3588,7 @@
- 
- 	return UPNP_E_SUCCESS;
- }
-+#endif
- 
- 
- /*!


=====================================
contrib/src/upnp/revert-ifaddrs.patch
=====================================
@@ -0,0 +1,272 @@
+From 1a6b54b37ac16d91d3d75ef1017a6ee5971a855f Mon Sep 17 00:00:00 2001
+From: Alaric Senat <dev.asenat at posteo.net>
+Date: Tue, 15 Jun 2021 16:29:07 +0200
+Subject: [PATCH] Revert "upnpapi.c: assume that getifaddrs is available"
+
+This reverts commit aa0166c9a87a6f02632a0c55fb6174b6a1bf8289.
+---
+ upnp/src/api/upnpapi.c | 227 ++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 225 insertions(+), 2 deletions(-)
+
+diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c
+index 2e95bbfc..3d524941 100644
+--- a/upnp/src/api/upnpapi.c
++++ b/upnp/src/api/upnpapi.c
+@@ -3558,6 +3558,7 @@ int UpnpDownloadXmlDoc(const char *url, IXML_Document **xmlDoc)
+ 	}
+ }
+ 
++#if (defined(BSD) && BSD >= 199306) || defined(__FreeBSD_kernel__)
+ /*!
+  * \brief Computes prefix length from IPv6 netmask.
+  *
+@@ -3580,6 +3581,7 @@ static unsigned UpnpComputeIpv6PrefixLength(struct sockaddr_in6 *Netmask)
+ 
+ 	return prefix_length;
+ }
++#endif
+ 
+ int UpnpGetIfInfo(const char *IfName)
+ {
+@@ -3743,7 +3745,8 @@ int UpnpGetIfInfo(const char *IfName)
+ 	}
+ 	inet_ntop(AF_INET, &v4_addr, gIF_IPV4, sizeof(gIF_IPV4));
+ 	inet_ntop(AF_INET6, &v6_addr, gIF_IPV6, sizeof(gIF_IPV6));
+-#else
++#elif (defined(BSD) && BSD >= 199306) || \
++	defined(__FreeBSD_kernel__) /* _WIN32 */
+ 	struct ifaddrs *ifap, *ifa;
+ 	struct in_addr v4_addr = {0};
+ 	struct in_addr v4_netmask = {0};
+@@ -3904,7 +3907,227 @@ int UpnpGetIfInfo(const char *IfName)
+ 			gIF_IPV6_ULA_GUA_PREFIX_LENGTH = v6ulagua_prefix;
+ 		}
+ 	}
+-#endif
++#else /* (defined(BSD) && BSD >= 199306) || defined(__FreeBSD_kernel__) */ /* _WIN32 */
++	struct ifreq ifArray[MAX_INTERFACES];
++	struct ifconf ifConf;
++	struct ifreq ifReq;
++	FILE *inet6_procfd;
++	int i;
++	int LocalSock;
++	struct in6_addr v6_addr;
++	unsigned if_idx;
++	unsigned if_prefix;
++	char addr6[8][5];
++	char buf[INET6_ADDRSTRLEN];
++	int ifname_found = 0;
++	int valid_addr_found = 0;
++
++	/* Copy interface name, if it was provided. */
++	if (IfName != NULL) {
++		if (strlen(IfName) > sizeof(gIF_NAME))
++			return UPNP_E_INVALID_INTERFACE;
++
++		memset(gIF_NAME, 0, sizeof(gIF_NAME));
++		strncpy(gIF_NAME, IfName, sizeof(gIF_NAME) - 1);
++		ifname_found = 1;
++	}
++	/* Create an unbound datagram socket to do the SIOCGIFADDR ioctl on.  */
++	if ((LocalSock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) ==
++		INVALID_SOCKET) {
++		UpnpPrintf(UPNP_ALL,
++			API,
++			__FILE__,
++			__LINE__,
++			"Can't create addrlist socket\n");
++		return UPNP_E_INIT;
++	}
++	/* Get the interface configuration information...  */
++	ifConf.ifc_len = (int)sizeof ifArray;
++	ifConf.ifc_ifcu.ifcu_buf = (char *)ifArray;
++
++	if (ioctl(LocalSock, SIOCGIFCONF, &ifConf) < 0) {
++		UpnpPrintf(UPNP_ALL,
++			API,
++			__FILE__,
++			__LINE__,
++			"DiscoverInterfaces: SIOCGIFCONF returned error\n");
++		close(LocalSock);
++		return UPNP_E_INIT;
++	}
++	if (ifConf.ifc_len == sizeof ifArray) {
++		UpnpPrintf(UPNP_ALL,
++			API,
++			__FILE__,
++			__LINE__,
++			"DiscoverInterfaces: ifConf.ifc_len == sizeof ifArray, "
++			"an overflow might have occurred, "
++			"operation should be retried with a bigger buffer.\n");
++	}
++	/* Cycle through the list of interfaces looking for IP addresses.  */
++	for (i = 0; i < ifConf.ifc_len; i += (int)(sizeof(struct ifreq))) {
++		struct ifreq *pifReq = (struct ifreq *)(ifConf.ifc_buf + i);
++		/* See if this is the sort of interface we want to deal with. */
++		memset(ifReq.ifr_name, 0, sizeof(ifReq.ifr_name));
++		strncpy(ifReq.ifr_name,
++			pifReq->ifr_name,
++			sizeof(ifReq.ifr_name) - 1);
++		if (ioctl(LocalSock, SIOCGIFFLAGS, &ifReq) < 0) {
++			UpnpPrintf(UPNP_ALL,
++				API,
++				__FILE__,
++				__LINE__,
++				"Can't get interface flags for %s:\n",
++				ifReq.ifr_name);
++		}
++		/* Skip LOOPBACK interfaces, DOWN interfaces and interfaces that
++		 * don't support MULTICAST. */
++		if ((ifReq.ifr_flags & IFF_LOOPBACK) ||
++			(!(ifReq.ifr_flags & IFF_UP)) ||
++			(!(ifReq.ifr_flags & IFF_MULTICAST))) {
++			continue;
++		}
++		if (ifname_found == 0) {
++			/* We have found a valid interface name. Keep it. */
++			memset(gIF_NAME, 0, sizeof(gIF_NAME));
++			strncpy(gIF_NAME,
++				pifReq->ifr_name,
++				sizeof(gIF_NAME) - 1);
++			ifname_found = 1;
++		} else {
++			if (strncmp(gIF_NAME,
++				    pifReq->ifr_name,
++				    sizeof(gIF_NAME)) != 0) {
++				/* This is not the interface we're looking for.
++				 */
++				continue;
++			}
++		}
++		/* Check address family. */
++		if (pifReq->ifr_addr.sa_family == AF_INET) {
++			/* Copy interface name, IPv4 address, IPv4 netmask and
++			 * interface index. */
++			memset(gIF_NAME, 0, sizeof(gIF_NAME));
++			strncpy(gIF_NAME,
++				pifReq->ifr_name,
++				sizeof(gIF_NAME) - 1);
++			inet_ntop(AF_INET,
++				&((struct sockaddr_in *)&pifReq->ifr_addr)
++					 ->sin_addr,
++				gIF_IPV4,
++				sizeof(gIF_IPV4));
++			if (ioctl(LocalSock, SIOCGIFNETMASK, &ifReq) < 0) {
++				UpnpPrintf(UPNP_ALL,
++					API,
++					__FILE__,
++					__LINE__,
++					"Can't get interface netmask for %s:\n",
++					ifReq.ifr_name);
++			}
++			inet_ntop(AF_INET,
++				&((struct sockaddr_in *)&ifReq.ifr_netmask)
++					 ->sin_addr,
++				gIF_IPV4_NETMASK,
++				sizeof(gIF_IPV4_NETMASK));
++			gIF_INDEX = if_nametoindex(gIF_NAME);
++			valid_addr_found = 1;
++			break;
++		} else {
++			/* Address is not IPv4 */
++			ifname_found = 0;
++		}
++	}
++	close(LocalSock);
++	/* Failed to find a valid interface, or valid address. */
++	if (ifname_found == 0 || valid_addr_found == 0) {
++		UpnpPrintf(UPNP_CRITICAL,
++			API,
++			__FILE__,
++			__LINE__,
++			"Failed to find an adapter with valid IP addresses for "
++			"use.\n");
++
++		return UPNP_E_INVALID_INTERFACE;
++	}
++	/* Try to get the IPv6 address for the same interface  */
++	/* from "/proc/net/if_inet6", if possible. */
++	inet6_procfd = fopen("/proc/net/if_inet6", "r");
++	if (inet6_procfd) {
++		while (fscanf(inet6_procfd,
++			       "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %*02x "
++			       "%*02x %*20s\n",
++			       addr6[0],
++			       addr6[1],
++			       addr6[2],
++			       addr6[3],
++			       addr6[4],
++			       addr6[5],
++			       addr6[6],
++			       addr6[7],
++			       &if_idx,
++			       &if_prefix) != EOF) {
++			/* Get same interface as IPv4 address retrieved. */
++			if (gIF_INDEX == if_idx) {
++				snprintf(buf,
++					sizeof(buf),
++					"%s:%s:%s:%s:%s:%s:%s:%s",
++					addr6[0],
++					addr6[1],
++					addr6[2],
++					addr6[3],
++					addr6[4],
++					addr6[5],
++					addr6[6],
++					addr6[7]);
++				/* Validate formed address and check for
++				 * link-local. */
++				if (inet_pton(AF_INET6, buf, &v6_addr) > 0) {
++					if (IN6_IS_ADDR_ULA(&v6_addr)) {
++						/* Got valid IPv6 ula. */
++						memset(gIF_IPV6_ULA_GUA,
++							0,
++							sizeof(gIF_IPV6_ULA_GUA));
++						strncpy(gIF_IPV6_ULA_GUA,
++							buf,
++							sizeof(gIF_IPV6_ULA_GUA) -
++								1);
++						gIF_IPV6_ULA_GUA_PREFIX_LENGTH =
++							if_prefix;
++					} else if (IN6_IS_ADDR_GLOBAL(
++							   &v6_addr) &&
++						   strlen(gIF_IPV6_ULA_GUA) ==
++							   (size_t)0) {
++						/* got a GUA, should store it
++						 * while no ULA is found */
++						memset(gIF_IPV6_ULA_GUA,
++							0,
++							sizeof(gIF_IPV6_ULA_GUA));
++						strncpy(gIF_IPV6_ULA_GUA,
++							buf,
++							sizeof(gIF_IPV6_ULA_GUA) -
++								1);
++						gIF_IPV6_ULA_GUA_PREFIX_LENGTH =
++							if_prefix;
++					} else if (IN6_IS_ADDR_LINKLOCAL(
++							   &v6_addr) &&
++						   strlen(gIF_IPV6) ==
++							   (size_t)0) {
++						/* got a Link local IPv6
++						 * address. */
++						memset(gIF_IPV6,
++							0,
++							sizeof(gIF_IPV6));
++						strncpy(gIF_IPV6,
++							buf,
++							sizeof(gIF_IPV6) - 1);
++						gIF_IPV6_PREFIX_LENGTH =
++							if_prefix;
++					}
++				}
++			}
++		}
++		fclose(inet6_procfd);
++	}
++#endif /* (defined(BSD) && BSD >= 199306) || defined(__FreeBSD_kernel__) */ /* _WIN32 */
+ 	UpnpPrintf(UPNP_INFO,
+ 		API,
+ 		__FILE__,
+-- 
+2.31.1
+


=====================================
contrib/src/upnp/rules.mak
=====================================
@@ -1,59 +1,59 @@
 # UPNP
-UPNP_VERSION := 1.6.19
+UPNP_VERSION := 1.14.11
 UPNP_URL := $(GITHUB)/pupnp/pupnp/archive/refs/tags/release-$(UPNP_VERSION).tar.gz
 
 ifdef BUILD_NETWORK
 PKGS += upnp
 endif
-ifeq ($(call need_pkg,"libupnp >= 1.6.18"),)
+ifeq ($(call need_pkg,"libupnp >= 1.6.19"),)
 PKGS_FOUND += upnp
 endif
 
-$(TARBALLS)/libupnp-$(UPNP_VERSION).tar.bz2:
+$(TARBALLS)/pupnp-release-$(UPNP_VERSION).tar.gz:
 	$(call download_pkg,$(UPNP_URL),upnp)
 
-.sum-upnp: libupnp-$(UPNP_VERSION).tar.bz2
+.sum-upnp: pupnp-release-$(UPNP_VERSION).tar.gz
+
+UPNP_CFLAGS := $(CFLAGS) -DUPNP_STATIC_LIB
+UPNP_CXXFLAGS := $(CXXFLAGS) -DUPNP_STATIC_LIB
+UPNP_CONF := --disable-samples
 
 ifdef HAVE_WIN32
 DEPS_upnp += pthreads $(DEPS_pthreads)
 endif
 ifdef HAVE_WINSTORE
-CONFIGURE_ARGS=--disable-ipv6 --enable-unspecified_server
+UPNP_CONF += --disable-ipv6 --enable-unspecified_server
 else
-CONFIGURE_ARGS=--enable-ipv6
+UPNP_CONF += --enable-ipv6
 endif
 ifndef WITH_OPTIMIZATION
-CONFIGURE_ARGS += --enable-debug
+UPNP_CONF += --enable-debug
 endif
 
-upnp: libupnp-$(UPNP_VERSION).tar.bz2 .sum-upnp
+upnp: pupnp-release-$(UPNP_VERSION).tar.gz .sum-upnp
 	$(UNPACK)
-	$(APPLY) $(SRC)/upnp/0001-Do-not-try-to-detach-detached-thread-the-result-is-u.patch
 ifdef HAVE_WIN32
+	$(APPLY) $(SRC)/upnp/libupnp-pthread-force.patch
+	$(APPLY) $(SRC)/upnp/libupnp-win32-exports.patch
 	$(APPLY) $(SRC)/upnp/libupnp-win32.patch
 	$(APPLY) $(SRC)/upnp/libupnp-win64.patch
-	$(APPLY) $(SRC)/upnp/windows-random.patch
 	$(APPLY) $(SRC)/upnp/windows-version-inet.patch
-	$(APPLY) $(SRC)/upnp/libupnp-win32-exports.patch
-	$(APPLY) $(SRC)/upnp/libupnp-pthread-w32-checks.patch
-	$(APPLY) $(SRC)/upnp/libupnp-pthread-w32-force.patch
-ifdef HAVE_WINSTORE
-	$(APPLY) $(SRC)/upnp/no-getifinfo.patch
 endif
+ifdef HAVE_LINUX
+ifndef HAVE_ANDROID
+	$(APPLY) $(SRC)/upnp/libupnp-pthread-force.patch
+endif
+endif
+ifdef HAVE_ANDROID
+	$(APPLY) $(SRC)/upnp/revert-ifaddrs.patch
 endif
-	$(APPLY) $(SRC)/upnp/libpthread.patch
-	$(APPLY) $(SRC)/upnp/libupnp-ipv6.patch
 	$(APPLY) $(SRC)/upnp/miniserver.patch
-	$(APPLY) $(SRC)/upnp/missing_win32.patch
-	$(APPLY) $(SRC)/upnp/fix_infinite_loop.patch
-	$(APPLY) $(SRC)/upnp/dont_use_down_intf.patch
 	$(APPLY) $(SRC)/upnp/upnp-no-debugfile.patch
-	$(APPLY) $(SRC)/upnp/use-unicode.patch
-	$(UPDATE_AUTOCONFIG) && cd $(UNPACK_DIR) && mv config.guess config.sub build-aux/
+	$(UPDATE_AUTOCONFIG)
 	$(MOVE)
 
 .upnp: upnp
 	$(RECONF)
-	cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) -DUPNP_STATIC_LIB" ./configure --disable-samples --without-documentation $(CONFIGURE_ARGS) $(HOSTCONF)
+	cd $< && $(HOSTVARS) CFLAGS="$(UPNP_CFLAGS)" CXXFLAGS="$(UPNP_CXXFLAGS)" ./configure $(UPNP_CONF) $(HOSTCONF)
 	cd $< && $(MAKE) install
 	touch $@


=====================================
contrib/src/upnp/upnp-no-debugfile.patch
=====================================
@@ -1,11 +1,25 @@
---- upnp/upnp/src/inc/config.h	2016-05-27 21:10:05.804950200 +0200
-+++ upnp/upnp/src/inc/config.h.debug	2016-05-27 20:59:31.808017700 +0200
-@@ -383,7 +383,7 @@
-  *
-  * @{
+From ef877d8c4991adf4d0615892fee64f6212f850b1 Mon Sep 17 00:00:00 2001
+From: Alaric Senat <dev.asenat at posteo.net>
+Date: Wed, 10 Mar 2021 14:54:00 +0100
+Subject: no-debugfile
+
+---
+ upnp/src/inc/config.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/upnp/src/inc/config.h b/upnp/src/inc/config.h
+index 8dc8cdb..6f2e17f 100644
+--- a/upnp/src/inc/config.h
++++ b/upnp/src/inc/config.h
+@@ -409,7 +409,7 @@
+  * see <upnp/inc/upnpdebug.h>
   */
--#define DEBUG_TARGET		1   
-+#define DEBUG_TARGET		0   
- /* @} */
- 
  
+-#define DEBUG_ALL		1
++#define DEBUG_ALL		0
+ #define DEBUG_SSDP		0
+ #define DEBUG_SOAP		0
+ #define DEBUG_GENA		0
+-- 
+2.29.2
+


=====================================
contrib/src/upnp/use-unicode.patch deleted
=====================================
@@ -1,49 +0,0 @@
---- upnp/upnp/src/api/upnpapi.c.orig	2017-03-17 17:21:09.510544751 +0100
-+++ upnp/upnp/src/api/upnpapi.c	2017-03-17 17:21:32.742531559 +0100
-@@ -3264,31 +3264,10 @@
- 		}
- 		if (ifname_found == 0) {
- 			/* We have found a valid interface name. Keep it. */
--#ifdef UPNP_USE_MSVCPP
--			/*
--			 * Partial fix for VC - friendly name is wchar string,
--			 * but currently gIF_NAME is char string. For now try
--			 * to convert it, which will work with many (but not
--			 * all) adapters. A full fix would require a lot of
--			 * big changes (gIF_NAME to wchar string?).
--			 */
- 			wcstombs(gIF_NAME, adapts_item->FriendlyName,
- 				sizeof(gIF_NAME));
--#else
--			memset(gIF_NAME, 0, sizeof(gIF_NAME));
--			strncpy(gIF_NAME, adapts_item->FriendlyName,
--				sizeof(gIF_NAME) - 1);
--#endif
- 			ifname_found = 1;
- 		} else {
--#ifdef UPNP_USE_MSVCPP
--			/*
--			 * Partial fix for VC - friendly name is wchar string,
--			 * but currently gIF_NAME is char string. For now try
--			 * to convert it, which will work with many (but not
--			 * all) adapters. A full fix would require a lot of
--			 * big changes (gIF_NAME to wchar string?).
--			 */
- 			char tmpIfName[LINE_SIZE] = { 0 };
- 			wcstombs(tmpIfName, adapts_item->FriendlyName,
- 				sizeof(tmpIfName));
-@@ -3298,14 +3277,6 @@
- 				/* This is not the interface we're looking for. */
- 				continue;
- 			}
--#else
--			if (strncmp
--			    (gIF_NAME, adapts_item->FriendlyName,
--			     sizeof(gIF_NAME)) != 0) {
--				/* This is not the interface we're looking for. */
--				continue;
--			}
--#endif
- 		}
- 		/* Loop thru this adapter's unicast IP addresses. */
- 		uni_addr = adapts_item->FirstUnicastAddress;


=====================================
contrib/src/upnp/windows-random.patch deleted
=====================================
@@ -1,34 +0,0 @@
-diff -ruN upnp/upnp/src/uuid/sysdep.c upnp.new/upnp/src/uuid/sysdep.c
---- upnp/upnp/src/uuid/sysdep.c	2011-04-03 04:50:36.000000000 +0200
-+++ upnp.new/upnp/src/uuid/sysdep.c	2016-05-09 19:08:15.225581588 +0200
-@@ -23,6 +23,8 @@
- 
- #include "config.h"
- 
-+#define _CRT_RAND_S
-+
- #include "sysdep.h"
- 
- #include "UpnpInet.h"
-@@ -78,6 +80,7 @@
- 
- void get_random_info(unsigned char seed[16])
- {
-+#if 0
- 	MD5_CTX c;
- 	typedef struct {
- 		MEMORYSTATUS m;
-@@ -108,6 +111,13 @@
- 	MD5Init(&c);
- 	MD5Update(&c, (unsigned char *)(&r), sizeof r);
- 	MD5Final(seed, &c);
-+#endif
-+    for( int i = 0; i < 16; i++ )
-+    {
-+        unsigned int number;
-+        rand_s(&number);
-+        seed[i] = number;
-+    }
- };
- 
- #else /* WIN32 */


=====================================
contrib/src/upnp/windows-version-inet.patch
=====================================
@@ -1,9 +1,20 @@
-diff -urN upnp-orig/upnp/src/inc/inet_pton.h upnp/upnp/src/inc/inet_pton.h
---- upnp-orig/upnp/src/inc/inet_pton.h	2010-12-23 22:24:06.000000000 +0200
-+++ upnp/upnp/src/inc/inet_pton.h	2018-02-24 23:44:22.359676036 +0200
+From a66d4779723f9aef75622157c76f5dc1ed1a33a3 Mon Sep 17 00:00:00 2001
+From: Alaric Senat <dev.asenat at posteo.net>
+Date: Wed, 10 Mar 2021 15:59:43 +0100
+Subject: windows version inet
+
+---
+ upnp/src/inc/inet_pton.h | 6 ++++++
+ upnp/src/inet_pton.c     | 5 +++++
+ 2 files changed, 11 insertions(+)
+
+diff --git a/upnp/src/inc/inet_pton.h b/upnp/src/inc/inet_pton.h
+index f3e08a5..e6233b5 100644
+--- a/upnp/src/inc/inet_pton.h
++++ b/upnp/src/inc/inet_pton.h
 @@ -3,6 +3,8 @@
  
- #ifdef WIN32
+ #ifdef _WIN32
  
 +#include "autoconfig.h"
 +
@@ -19,31 +30,36 @@ diff -urN upnp-orig/upnp/src/inc/inet_pton.h upnp/upnp/src/inc/inet_pton.h
  /*!
   * \file
   *
-@@ -45,6 +49,8 @@
+@@ -45,6 +49,8 @@ extern const char *inet_ntop(int af, const void *src, char *dst,
   */
  extern int inet_pton(int af, const char *src, void *dst);
  
 +#endif /* _WIN32_WINNT < 0x600 */
 +
- #endif /* WIN32 */
+ #endif /* _WIN32 */
  
  #endif /* INET_PTON */
-diff -urN upnp-orig/upnp/src/inet_pton.c upnp/upnp/src/inet_pton.c
---- upnp-orig/upnp/src/inet_pton.c	2010-12-23 22:24:06.000000000 +0200
-+++ upnp/upnp/src/inet_pton.c	2018-02-24 23:44:16.771807657 +0200
-@@ -24,6 +24,8 @@
+diff --git a/upnp/src/inet_pton.c b/upnp/src/inet_pton.c
+index e2a243b..73c0a16 100644
+--- a/upnp/src/inet_pton.c
++++ b/upnp/src/inet_pton.c
+@@ -24,6 +24,9 @@
  
- #include "inet_pton.h"
+ 	#include "inet_pton.h"
  
 +#if _WIN32_WINNT < 0x600
++
 +
  /*!
   * \brief format an IPv4 address
   *
-@@ -320,4 +322,6 @@
+@@ -324,4 +327,6 @@ int inet_pton(int af, const char *src, void *dst)
  	/* NOTREACHED */
  }
  
 +#endif /* _WIN32_WINNT < 0x600 */
 +
- #endif /* WIN32 */
+ #endif /* _WIN32 */
+-- 
+2.29.2
+


=====================================
contrib/src/upnp/winrt-dont-force-win32-winnt.patch deleted
=====================================
@@ -1,10 +0,0 @@
---- upnp/configure.ac.orig	2016-05-10 11:28:35.866723477 +0200
-+++ upnp/configure.ac	2016-05-10 11:28:58.186564849 +0200
-@@ -676,7 +676,6 @@
- AC_SUBST(PTHREAD_CFLAGS)
- AC_SUBST(PTHREAD_CC)
- 
--AC_DEFINE([_WIN32_WINNT], 0x0501, [Define to '0x0500' for Windows 2000 APIs.])
- #
- # Determine if pthread_rwlock_t is available
- #


=====================================
extras/package/snap/snapcraft.yaml
=====================================
@@ -78,7 +78,6 @@ parts:
           --host=$TRIPLET \
           --enable-libdsm \
           --enable-dvdcss \
-          --disable-upnp \
           --disable-chromaprint
       if [ -n "$VLC_PREBUILT_CONTRIBS_URL" ]; then
           make prebuilt PREBUILT_URL="$VLC_PREBUILT_CONTRIBS_URL"
@@ -139,7 +138,6 @@ parts:
       - librsvg2-dev
       - libsecret-1-dev
       - libudev-dev
-      - libupnp-dev
       - libv4l-dev
       - libva-dev
       - libvdpau-dev
@@ -215,7 +213,6 @@ parts:
       - libgtk-3-0
       - liblua5.2-0
       - libmtp9
-      - libupnp6
       - libzvbi0
       - libnotify4
       - libvulkan1


=====================================
modules/services_discovery/upnp.cpp
=====================================
@@ -1437,8 +1437,6 @@ static IP_ADAPTER_ADDRESSES* ListAdapters()
     return addresses;
 }
 
-#ifdef UPNP_ENABLE_IPV6
-
 static char* getPreferedAdapter()
 {
     IP_ADAPTER_ADDRESSES *p_adapter, *addresses;
@@ -1468,8 +1466,6 @@ static char* getPreferedAdapter()
     return NULL;
 }
 
-#else
-
 static char *getIpv4ForMulticast()
 {
     IP_ADAPTER_UNICAST_ADDRESS *p_best_ip = NULL;
@@ -1556,11 +1552,8 @@ done:
     free(addresses);
     return NULL;
 }
-#endif /* UPNP_ENABLE_IPV6 */
 #else /* _WIN32 */
 
-#ifdef UPNP_ENABLE_IPV6
-
 #ifdef __APPLE__
 #include <TargetConditionals.h>
 
@@ -1671,15 +1664,12 @@ inline char *getPreferedAdapter()
 }
 
 #endif
-#else
 
 static char *getIpv4ForMulticast()
 {
     return NULL;
 }
 
-#endif
-
 #endif /* _WIN32 */
 
 UpnpInstanceWrapper *UpnpInstanceWrapper::get(vlc_object_t *p_obj, services_discovery_t *p_sd)
@@ -1705,7 +1695,9 @@ UpnpInstanceWrapper *UpnpInstanceWrapper::get(vlc_object_t *p_obj, services_disc
             return NULL;
         }
 
-    #ifdef UPNP_ENABLE_IPV6
+        /* libupnp 1.8.3 deprecate `UpnpInit` and introduce `UpnpInit2` as a replacement.
+           libupnp <1.8.3 provides `UpnpInit2` only if built with IPv6. */
+    #if UPNP_VERSION >= 10803 || defined( UPNP_ENABLE_IPV6 )
         char* psz_miface = var_InheritString( p_obj, "miface" );
         if (psz_miface == NULL)
             psz_miface = getPreferedAdapter();
@@ -1713,11 +1705,11 @@ UpnpInstanceWrapper *UpnpInstanceWrapper::get(vlc_object_t *p_obj, services_disc
         int i_res = UpnpInit2( psz_miface, 0 );
         free( psz_miface );
     #else
-        /* If UpnpInit2 isnt available, initialize on first IPv4-capable interface */
+        /* If UpnpInit2 isn't available, initialize on first IPv4-capable interface */
         char *psz_hostip = getIpv4ForMulticast();
         int i_res = UpnpInit( psz_hostip, 0 );
         free(psz_hostip);
-    #endif /* UPNP_ENABLE_IPV6 */
+    #endif /* UPNP_VERSION >= 10803 || defined( UPNP_ENABLE_IPV6 ) */
         if( i_res != UPNP_E_SUCCESS )
         {
             msg_Err( p_obj, "Initialization failed: %s", UpnpGetErrorMessage( i_res ) );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8ff56952174af8e7a7d4ae61a413f88317c948a1...2baf4b09f71ca0455e8844f3cd2804877cecd73a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8ff56952174af8e7a7d4ae61a413f88317c948a1...2baf4b09f71ca0455e8844f3cd2804877cecd73a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list