From: Russ Combs Date: Fri, 23 May 2014 18:09:07 +0000 (-0400) Subject: remove pthread and harden --enable-inline-failopen X-Git-Tag: 3.0.0-233~1517 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0a5aebefd7dd125226343f4d5ade73d83ea8753b;p=thirdparty%2Fsnort3.git remove pthread and harden --enable-inline-failopen --- diff --git a/configure.ac b/configure.ac index 4b8208b6d..3a408dd2e 100644 --- a/configure.ac +++ b/configure.ac @@ -352,23 +352,6 @@ if test "x$enable_linux_smp_stats" = "xyes"; then AC_DEFINE(LINUX_SMP, [1], [enable proc stats]) fi -AC_ARG_ENABLE(inline-init-failopen, -[ --enable-inline-init-failopen Enable Fail Open during initialization for Inline Mode (adds pthread support implicitly)], - enable_inline_init_failopen="$enableval", enable_inline_init_failopen="no") - -if test "x$enable_inline_init_failopen" = "xyes"; then - AC_DEFINE(INLINE_FAILOPEN, [1], [pass packet during initialization]) - LIBS="$LIBS -lpthread" -fi - -AC_ARG_ENABLE(pthread, -[ --disable-pthread Disable pthread support], - enable_pthread="$enableval", enable_pthread="yes") - -if test "x$enable_pthread" = "xyes"; then - LIBS="$LIBS -lpthread" -fi - AC_ARG_ENABLE(debug-msgs, [ --enable-debug-msgs Enable debug printing options (bugreports and developers only)], enable_debug_msgs="$enableval", enable_debug_msgs="no") @@ -429,8 +412,6 @@ if test "x$enable_corefiles" = "xno"; then AC_DEFINE(NOCOREFILE, [1], [do not generate a core file on segfault etc.]) fi -LIBS="$LIBS -lpthread" - AC_ARG_ENABLE(non-ether-decoders, [ --enable-non-ether-decoders Enable non Ethernet decoders.], enable_non_ether_decoders="$enableval", enable_non_ether_decoders="no") diff --git a/doc/differences.txt b/doc/differences.txt index a754d70cf..a26137702 100644 --- a/doc/differences.txt +++ b/doc/differences.txt @@ -13,6 +13,7 @@ Snort++ differs from Snort in the following ways: * configure --with-lib{pcap,pcre}-* -> --with-{pcap,pcre}-* * control socket, cs_dir, and users were deleted * POLICY_BY_ID_ONLY code was deleted +* hardened --enable-inline-init-failopen / INLINE_FAILOPEN === Command Line diff --git a/src/main/modules.cc b/src/main/modules.cc index 4acbd40a5..35d076559 100644 --- a/src/main/modules.cc +++ b/src/main/modules.cc @@ -817,10 +817,8 @@ static const Parameter packets_params[] = { "bpf_file", Parameter::PT_STRING, nullptr, nullptr, "file with BPF to select traffic for Snort" }, -#ifdef INLINE_FAILOPEN { "enable_inline_init_failopen", Parameter::PT_BOOL, nullptr, "true", "whether to pass traffic during later stage of initialization to avoid drops" }, -#endif { "limit", Parameter::PT_INT, "0:", "0", "maximum number of packets to process before stopping (0 is unlimited)" }, @@ -849,13 +847,11 @@ bool PacketsModule::set(const char*, Value& v, SnortConfig* sc) else if ( v.is("bpf_file") ) sc->bpf_file = SnortStrdup(v.get_string()); -#ifdef INLINE_FAILOPEN else if ( v.is("enable_inline_init_failopen") ) { if ( !v.get_bool() ) sc->run_flags |= RUN_FLAG__DISABLE_FAILOPEN; } -#endif else if ( v.is("limit") ) sc->pkt_cnt = v.get_long(); diff --git a/src/main/snort.h b/src/main/snort.h index 89c3e0c11..99aaebe57 100644 --- a/src/main/snort.h +++ b/src/main/snort.h @@ -109,9 +109,7 @@ typedef enum _RunFlag RUN_FLAG__PROCESS_ALL_EVENTS = 0x00002000, RUN_FLAG__INLINE_TEST = 0x00004000, /* --enable-inline-test*/ -#ifdef INLINE_FAILOPEN RUN_FLAG__DISABLE_FAILOPEN = 0x00100000, /* --disable-inline-init-failopen */ -#endif RUN_FLAG__PCAP_RESET = 0x00200000, RUN_FLAG__PCAP_SHOW = 0x00400000, RUN_FLAG__PAUSE = 0x00800000, // --pause @@ -414,12 +412,10 @@ static inline int ScDefaultRuleState(void) return snort_conf->default_rule_state; } -#ifdef INLINE_FAILOPEN static inline int ScDisableInlineFailopen(void) { return snort_conf->run_flags & RUN_FLAG__DISABLE_FAILOPEN; } -#endif static inline int ScNoLockPidFile(void) {