mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
mapport: require miniupnpc API version 17 or later
Version 17 is currently the latest version, and has been available since the release of 2.1. See: https://github.com/miniupnp/miniupnp/blob/master/miniupnpc/apiversions.txt.
This commit is contained in:
parent
2d5acc901d
commit
b3b673f704
3 changed files with 9 additions and 12 deletions
|
@ -1416,14 +1416,15 @@ if test "$use_upnp" != "no"; then
|
|||
[AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc"], [have_miniupnpc=no], [$MINIUPNPC_LIBS])],
|
||||
[have_miniupnpc=no]
|
||||
)
|
||||
dnl The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
|
||||
dnl with Ubuntu 16.04 LTS and Debian 8 libminiupnpc-dev packages.
|
||||
|
||||
dnl The minimum supported miniUPnPc API version is set to 17. This excludes
|
||||
dnl versions with known vulnerabilities.
|
||||
if test "$have_miniupnpc" != "no"; then
|
||||
AC_MSG_CHECKING([whether miniUPnPc API version is supported])
|
||||
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
|
||||
@%:@include <miniupnpc/miniupnpc.h>
|
||||
]], [[
|
||||
#if MINIUPNPC_API_VERSION >= 10
|
||||
#if MINIUPNPC_API_VERSION >= 17
|
||||
// Everything is okay
|
||||
#else
|
||||
# error miniUPnPc API version is too old
|
||||
|
@ -1432,7 +1433,7 @@ if test "$use_upnp" != "no"; then
|
|||
AC_MSG_RESULT([yes])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([miniUPnPc API version < 10 is unsupported, disabling UPnP support.])
|
||||
AC_MSG_WARN([miniUPnPc API version < 17 is unsupported, disabling UPnP support.])
|
||||
have_miniupnpc=no
|
||||
])
|
||||
fi
|
||||
|
|
|
@ -36,7 +36,7 @@ You can find installation instructions in the `build-*.md` file for your platfor
|
|||
| Dependency | Releases | Version used | Minimum required | Runtime |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| [libnatpmp](../depends/packages/libnatpmp.mk) | [link](https://github.com/miniupnp/libnatpmp/) | commit [07004b9...](https://github.com/bitcoin/bitcoin/pull/25917) | | No |
|
||||
| [MiniUPnPc](../depends/packages/miniupnpc.mk) | [link](https://miniupnp.tuxfamily.org/) | [2.2.2](https://github.com/bitcoin/bitcoin/pull/20421) | 1.9 | No |
|
||||
| [MiniUPnPc](../depends/packages/miniupnpc.mk) | [link](https://miniupnp.tuxfamily.org/) | [2.2.2](https://github.com/bitcoin/bitcoin/pull/20421) | 2.1 | No |
|
||||
|
||||
### Notifications
|
||||
| Dependency | Releases | Version used | Minimum required | Runtime |
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
#include <miniupnpc/miniupnpc.h>
|
||||
#include <miniupnpc/upnpcommands.h>
|
||||
#include <miniupnpc/upnperrors.h>
|
||||
// The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
|
||||
// with Ubuntu 16.04 LTS and Debian 8 libminiupnpc-dev packages.
|
||||
static_assert(MINIUPNPC_API_VERSION >= 10, "miniUPnPc API version >= 10 assumed");
|
||||
// The minimum supported miniUPnPc API version is set to 17. This excludes
|
||||
// versions with known vulnerabilities.
|
||||
static_assert(MINIUPNPC_API_VERSION >= 17, "miniUPnPc API version >= 17 assumed");
|
||||
#endif // USE_UPNP
|
||||
|
||||
#include <atomic>
|
||||
|
@ -159,11 +159,7 @@ static bool ProcessUpnp()
|
|||
char lanaddr[64];
|
||||
|
||||
int error = 0;
|
||||
#if MINIUPNPC_API_VERSION < 14
|
||||
devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error);
|
||||
#else
|
||||
devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, 2, &error);
|
||||
#endif
|
||||
|
||||
struct UPNPUrls urls;
|
||||
struct IGDdatas data;
|
||||
|
|
Loading…
Add table
Reference in a new issue