Skip to content

Commit 5bed6ea

Browse files
committed
merge bitcoin#27016: require miniupnpc API version 17 or later
1 parent 51a9f24 commit 5bed6ea

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

configure.ac

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,14 +1518,15 @@ if test "$use_upnp" != "no"; then
15181518
[AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc"], [have_miniupnpc=no], [$MINIUPNPC_LIBS])],
15191519
[have_miniupnpc=no]
15201520
)
1521-
dnl The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
1522-
dnl with Ubuntu 16.04 LTS and Debian 8 libminiupnpc-dev packages.
1521+
1522+
dnl The minimum supported miniUPnPc API version is set to 17. This excludes
1523+
dnl versions with known vulnerabilities.
15231524
if test "$have_miniupnpc" != "no"; then
15241525
AC_MSG_CHECKING([whether miniUPnPc API version is supported])
15251526
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
15261527
@%:@include <miniupnpc/miniupnpc.h>
15271528
]], [[
1528-
#if MINIUPNPC_API_VERSION >= 10
1529+
#if MINIUPNPC_API_VERSION >= 17
15291530
// Everything is okay
15301531
#else
15311532
# error miniUPnPc API version is too old
@@ -1534,7 +1535,7 @@ if test "$use_upnp" != "no"; then
15341535
AC_MSG_RESULT([yes])
15351536
],[
15361537
AC_MSG_RESULT([no])
1537-
AC_MSG_WARN([miniUPnPc API version < 10 is unsupported, disabling UPnP support.])
1538+
AC_MSG_WARN([miniUPnPc API version < 17 is unsupported, disabling UPnP support.])
15381539
have_miniupnpc=no
15391540
])
15401541
fi

doc/dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You can find installation instructions in the `build-*.md` file for your platfor
3939
| Dependency | Releases | Version used | Minimum required | Runtime |
4040
| --- | --- | --- | --- | --- |
4141
| [libnatpmp](../depends/packages/libnatpmp.mk) | [link](https://github.com/miniupnp/libnatpmp/) | commit [07004b9...](https://github.com/miniupnp/libnatpmp/tree/07004b97cf691774efebe70404cf22201e4d330d) | | No |
42-
| [MiniUPnPc](../depends/packages/miniupnpc.mk) | [link](https://miniupnp.tuxfamily.org/) | [2.2.2](https://github.com/bitcoin/bitcoin/pull/20421) | 1.9 | No |
42+
| [MiniUPnPc](../depends/packages/miniupnpc.mk) | [link](https://miniupnp.tuxfamily.org/) | [2.2.2](https://github.com/bitcoin/bitcoin/pull/20421) | 2.1 | No |
4343

4444
### Notifications
4545
| Dependency | Releases | Version used | Minimum required | Runtime |

src/mapport.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
#include <miniupnpc/miniupnpc.h>
2727
#include <miniupnpc/upnpcommands.h>
2828
#include <miniupnpc/upnperrors.h>
29-
// The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
30-
// with Ubuntu 16.04 LTS and Debian 8 libminiupnpc-dev packages.
31-
static_assert(MINIUPNPC_API_VERSION >= 10, "miniUPnPc API version >= 10 assumed");
29+
// The minimum supported miniUPnPc API version is set to 17. This excludes
30+
// versions with known vulnerabilities.
31+
static_assert(MINIUPNPC_API_VERSION >= 17, "miniUPnPc API version >= 17 assumed");
3232
#endif // USE_UPNP
3333

3434
#include <atomic>
@@ -158,11 +158,7 @@ static bool ProcessUpnp()
158158
char lanaddr[64];
159159

160160
int error = 0;
161-
#if MINIUPNPC_API_VERSION < 14
162-
devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error);
163-
#else
164161
devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, 2, &error);
165-
#endif
166162

167163
struct UPNPUrls urls;
168164
struct IGDdatas data;

0 commit comments

Comments
 (0)