From c43b43888535f394ad2167e0f5373406ad5e385f Mon Sep 17 00:00:00 2001 From: Pavel Odintsov Date: Sat, 17 Feb 2024 17:41:26 +0000 Subject: [PATCH] Removed not used platform configuration parameter as we read it from configuraration file --- src/CMakeLists.txt | 2 -- src/fast_platform.h.template | 3 --- src/fastnetmon.cpp | 4 +++- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 534b42e..b040ef5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -190,7 +190,6 @@ set(FASTNETMON_ATTACK_DETAILS_FOLDER "/var/log/fastnetmon_attacks") set(FASTNETMON_NOTIFY_SCRIPT_PATH_DEFAULT "/usr/local/bin/notify_about_attack.sh") set(FASTNETMON_NETWORK_WHITELIST_PATH "/etc/networks_whitelist") set(FASTNETMON_NETWORKS_LIST_PATH "/etc/networks_list") -set(FASTNETMON_COMMAND_PIPE_PATH "/var/run/exabgp.cmd") set(FASTNETMON_BACKTRACE_PATH "/var/log/fastnetmon_backtrace.dump") # For FreeBSD based platforms we need to adjust them @@ -204,7 +203,6 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Dr set(FASTNETMON_NOTIFY_SCRIPT_PATH_DEFAULT "${FREEBSD_DEFAULT_PREFIX}/bin/notify_about_attack.sh") set(FASTNETMON_NETWORK_WHITELIST_PATH "${FREEBSD_DEFAULT_PREFIX}/etc/networks_whitelist") set(FASTNETMON_NETWORKS_LIST_PATH "${FREEBSD_DEFAULT_PREFIX}/etc/networks_list") - set(FASTNETMON_COMMAND_PIPE_PATH "/var/run/fastnetmon/exabgp.cmd") set(FASTNETMON_BACKTRACE_PATH "/var/log/fastnetmon/fastnetmon_backtrace.dump") endif() diff --git a/src/fast_platform.h.template b/src/fast_platform.h.template index 6ac2f52..0946439 100644 --- a/src/fast_platform.h.template +++ b/src/fast_platform.h.template @@ -22,9 +22,6 @@ class FastnetmonPlatformConfigurtion { // Default path to file with all networks listing std::string networks_list_path = "${FASTNETMON_NETWORKS_LIST_PATH}"; - // Path to ExaBGP pipe - std::string exabgp_command_pipe = "${FASTNETMON_COMMAND_PIPE_PATH}"; - // Path to temporarily store backtrace when fatal failure happened std::string backtrace_path = "${FASTNETMON_BACKTRACE_PATH}"; }; diff --git a/src/fastnetmon.cpp b/src/fastnetmon.cpp index e47adea..581d576 100644 --- a/src/fastnetmon.cpp +++ b/src/fastnetmon.cpp @@ -236,6 +236,8 @@ bool monitor_openvz_vps_ip_addresses = false; // We will announce whole subnet instead single IP with BGP if this flag enabled bool exabgp_announce_whole_subnet = false; +std::string exabgp_command_pipe = ""; + // We will announce only /32 host bool exabgp_announce_host = false; @@ -1515,7 +1517,7 @@ void redirect_fds() { // Handles fatal failure of FastNetMon's daemon void fatal_signal_handler(int signum) { ::signal(signum, SIG_DFL); - boost::stacktrace::safe_dump_to(backtrace_path.c_str()); + boost::stacktrace::safe_dump_to(fastnetmon_platform_configuration.backtrace_path.c_str()); ::raise(SIGABRT); }