From: Davis McPherson -X (davmcphe - XORIANT CORPORATION at Cisco) Date: Fri, 9 May 2025 20:34:00 +0000 (+0000) Subject: Pull request #4726: stream_tcp: deprecate the reassemble_async configuration option X-Git-Tag: 3.8.1.0~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1fc0b20a380ef6f232d8f178ed8a606d6e60be5e;p=thirdparty%2Fsnort3.git Pull request #4726: stream_tcp: deprecate the reassemble_async configuration option Merge in SNORT/snort3 from ~DAVMCPHE/snort3:deprecate_reassemble_async to master Squashed commit of the following: commit 18400e7d9fda158c3fc59d73060312b70795f93f Author: davis mcpherson Date: Tue May 6 08:29:46 2025 -0400 stream_tcp: deprecate the reassemble_async configuration option commit a5a8fe2fb28ee6cc33391f1453b5599c3e0928e0 Author: davis mcpherson Date: Mon May 5 23:18:17 2025 -0400 snort2lua: add include for cstdint to provide standard c++ integer types --- diff --git a/src/stream/tcp/tcp_module.cc b/src/stream/tcp/tcp_module.cc index fe2d7000e..1053f2069 100644 --- a/src/stream/tcp/tcp_module.cc +++ b/src/stream/tcp/tcp_module.cc @@ -363,10 +363,8 @@ bool StreamTcpModule::set(const char*, Value& v, SnortConfig*) else if ( v.is("reassemble_async") ) { - if ( v.get_bool() ) - config->flags &= ~STREAM_CONFIG_NO_ASYNC_REASSEMBLY; - else - config->flags |= STREAM_CONFIG_NO_ASYNC_REASSEMBLY; + // this option is deprecated, reassembly on asymmetric connections + // is always enabled } else if ( v.is("require_3whs") ) diff --git a/src/stream/tcp/tcp_session.cc b/src/stream/tcp/tcp_session.cc index 915bb29eb..b1d0a380b 100644 --- a/src/stream/tcp/tcp_session.cc +++ b/src/stream/tcp/tcp_session.cc @@ -679,9 +679,7 @@ bool TcpSession::check_reassembly_queue_thresholds(TcpSegmentDescriptor& tsd, Tc bool TcpSession::filter_packet_for_reassembly(TcpSegmentDescriptor& tsd, TcpStreamTracker* listener) { - if ( tsd.are_packet_flags_set(PKT_IGNORE) - or listener->get_flush_policy() == STREAM_FLPOLICY_IGNORE - or ( ( tcp_config->flags & STREAM_CONFIG_NO_ASYNC_REASSEMBLY ) && !flow->two_way_traffic() ) ) + if ( tsd.are_packet_flags_set(PKT_IGNORE) or listener->get_flush_policy() == STREAM_FLPOLICY_IGNORE ) return false; return !check_reassembly_queue_thresholds(tsd, listener); diff --git a/src/stream/tcp/tcp_stream_config.cc b/src/stream/tcp/tcp_stream_config.cc index 927e0c240..13f0d1eda 100644 --- a/src/stream/tcp/tcp_stream_config.cc +++ b/src/stream/tcp/tcp_stream_config.cc @@ -55,7 +55,7 @@ void TcpStreamConfig::show() const str += std::to_string(asymmetric_ids_flush_threshold); str += " }"; ConfigLogger::log_value("asymmetric_ids", str.c_str()); - ConfigLogger::log_flag("reassemble_async", !(flags & STREAM_CONFIG_NO_ASYNC_REASSEMBLY)); + ConfigLogger::log_value("reassemble_async", "deprecated, has no effect"); ConfigLogger::log_value("session_timeout", session_timeout); str = "{ count = "; diff --git a/src/stream/tcp/tcp_stream_config.h b/src/stream/tcp/tcp_stream_config.h index 3c0513a9c..06270e331 100644 --- a/src/stream/tcp/tcp_stream_config.h +++ b/src/stream/tcp/tcp_stream_config.h @@ -27,8 +27,7 @@ #include "time/packet_time.h" #define STREAM_CONFIG_SHOW_PACKETS 0x00000001 -#define STREAM_CONFIG_NO_ASYNC_REASSEMBLY 0x00000002 -#define STREAM_CONFIG_NO_REASSEMBLY 0x00000004 +#define STREAM_CONFIG_NO_REASSEMBLY 0x00000002 #define STREAM_DEFAULT_SSN_TIMEOUT 30