diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d95993..e971c32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) set_property(GLOBAL PROPERTY USE_FOLDERS ON) -if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") +if(${CMAKE_SYSTEM_NAME} MATCHES "^DragonFly?" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") include_directories("/usr/local/include") include_directories("/usr/local/include/botan-2") endif() diff --git a/src/main.cpp b/src/main.cpp index e0f9e04..d2f8ddd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,7 +14,7 @@ int main(int argc, char *argv[]) if (argc <= 1) { char app_name[] = "punchnat"; - printf("%s version 20230423\n", app_name); + printf("%s version 20230426\n", app_name); printf("Usage: %s config1.conf\n", app_name); printf(" %s config1.conf config2.conf...\n", app_name); return 0; @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) tcp_sessions.emplace_back(tcp_mode(ioc, settings)); } - std::cout << "error_found: " << (error_found ? "Yes" : "No") << "\n"; + std::cout << "Error Found in Configuration File(s): " << (error_found ? "Yes" : "No") << "\n"; std::cout << "TCP: " << tcp_sessions.size() << "\n"; std::cout << "UDP: " << udp_sessions.size() << "\n"; @@ -74,6 +74,5 @@ int main(int argc, char *argv[]) network_io.run(); } - printf("bye\n"); return 0; } \ No newline at end of file diff --git a/src/networks/connections.cpp b/src/networks/connections.cpp index 1435aee..4771080 100644 --- a/src/networks/connections.cpp +++ b/src/networks/connections.cpp @@ -541,10 +541,16 @@ int64_t udp_client::time_gap_of_send() void udp_client::initialise() { - asio::ip::v6_only v6_option(false); - connection_socket.open(udp::v6()); - if (!ipv4_only) + if (ipv4_only) + { + connection_socket.open(udp::v4()); + } + else + { + asio::ip::v6_only v6_option(false); + connection_socket.open(udp::v6()); connection_socket.set_option(v6_option); + } } void udp_client::start_receive() diff --git a/src/shares/share_defines.cpp b/src/shares/share_defines.cpp index 0b567d1..a9bf2a1 100644 --- a/src/shares/share_defines.cpp +++ b/src/shares/share_defines.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include