2020-10-07 15:32:44 +00:00
|
|
|
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
|
2024-09-09 00:41:40 +00:00
|
|
|
index 5b7f69a56..cc4b0a346 100644
|
2020-10-07 15:32:44 +00:00
|
|
|
--- a/external/CMakeLists.txt
|
|
|
|
+++ b/external/CMakeLists.txt
|
2024-09-09 00:41:40 +00:00
|
|
|
@@ -35,25 +35,14 @@
|
|
|
|
# ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with
|
|
|
|
# others.
|
2020-10-07 15:32:44 +00:00
|
|
|
|
2024-09-09 00:41:40 +00:00
|
|
|
-find_package(Miniupnpc REQUIRED)
|
|
|
|
-
|
2020-10-07 15:32:44 +00:00
|
|
|
-message(STATUS "Using in-tree miniupnpc")
|
2021-12-09 23:19:02 +00:00
|
|
|
-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
|
2020-10-07 15:32:44 +00:00
|
|
|
-add_subdirectory(miniupnp/miniupnpc)
|
|
|
|
-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
|
2021-12-09 23:19:02 +00:00
|
|
|
-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON)
|
2020-10-07 15:32:44 +00:00
|
|
|
-if(MSVC)
|
|
|
|
- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
|
|
|
|
-elseif(NOT MSVC)
|
|
|
|
- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
|
|
|
|
-endif()
|
|
|
|
-if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
|
|
|
- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE")
|
|
|
|
-endif()
|
2024-07-11 17:14:44 +00:00
|
|
|
-
|
2024-09-09 00:41:40 +00:00
|
|
|
-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
|
|
|
|
+find_package(PkgConfig REQUIRED)
|
|
|
|
+pkg_check_modules(MINIUPNPC REQUIRED miniupnpc)
|
|
|
|
+link_libraries(${MINIUPNPC_LIBRARIES})
|
|
|
|
+include_directories(${MINIUPNPC_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
+find_package(RapidJSON)
|
2020-10-07 15:32:44 +00:00
|
|
|
find_package(Unbound)
|
2024-09-09 00:41:40 +00:00
|
|
|
+find_library(RANDOMX_LIBRARY randomx)
|
2020-10-07 15:32:44 +00:00
|
|
|
|
2024-07-11 17:14:44 +00:00
|
|
|
if(NOT UNBOUND_INCLUDE_DIR)
|
2024-09-09 00:41:40 +00:00
|
|
|
die("Could not find libunbound")
|
|
|
|
@@ -69,4 +58,3 @@ endif()
|
2020-10-07 15:32:44 +00:00
|
|
|
add_subdirectory(db_drivers)
|
|
|
|
add_subdirectory(easylogging++)
|
|
|
|
add_subdirectory(qrcodegen)
|
|
|
|
-add_subdirectory(randomx EXCLUDE_FROM_ALL)
|
2024-09-09 00:41:40 +00:00
|
|
|
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
|
|
|
|
index 71f5393e8..bb48083d0 100644
|
|
|
|
--- a/src/p2p/net_node.inl
|
|
|
|
+++ b/src/p2p/net_node.inl
|
|
|
|
@@ -60,9 +60,9 @@
|
|
|
|
#include "cryptonote_core/cryptonote_core.h"
|
|
|
|
#include "net/parse.h"
|
|
|
|
|
|
|
|
-#include <miniupnp/miniupnpc/miniupnpc.h>
|
|
|
|
-#include <miniupnp/miniupnpc/upnpcommands.h>
|
|
|
|
-#include <miniupnp/miniupnpc/upnperrors.h>
|
|
|
|
+#include <miniupnpc/miniupnpc.h>
|
|
|
|
+#include <miniupnpc/upnpcommands.h>
|
|
|
|
+#include <miniupnpc/upnperrors.h>
|
|
|
|
|
|
|
|
#undef MONERO_DEFAULT_LOG_CATEGORY
|
|
|
|
#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"
|
|
|
|
@@ -2989,7 +2989,8 @@ namespace nodetool
|
|
|
|
UPNPUrls urls;
|
|
|
|
IGDdatas igdData;
|
|
|
|
char lanAddress[64];
|
|
|
|
- result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress);
|
|
|
|
+ char wanAddress[64];
|
|
|
|
+ result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof wanAddress);
|
|
|
|
freeUPNPDevlist(deviceList);
|
|
|
|
if (result > 0) {
|
|
|
|
if (result == 1) {
|
|
|
|
@@ -3057,7 +3058,8 @@ namespace nodetool
|
|
|
|
UPNPUrls urls;
|
|
|
|
IGDdatas igdData;
|
|
|
|
char lanAddress[64];
|
|
|
|
- result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress);
|
|
|
|
+ char wanAddress[64];
|
|
|
|
+ result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof wanAddress);
|
|
|
|
freeUPNPDevlist(deviceList);
|
|
|
|
if (result > 0) {
|
|
|
|
if (result == 1) {
|