]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4726: stream_tcp: deprecate the reassemble_async configuration option
authorDavis McPherson -X (davmcphe - XORIANT CORPORATION at Cisco) <davmcphe@cisco.com>
Fri, 9 May 2025 20:34:00 +0000 (20:34 +0000)
committerSteven Baigal (sbaigal) <sbaigal@cisco.com>
Fri, 9 May 2025 20:34:00 +0000 (20:34 +0000)
Merge in SNORT/snort3 from ~DAVMCPHE/snort3:deprecate_reassemble_async to master

Squashed commit of the following:

commit 18400e7d9fda158c3fc59d73060312b70795f93f
Author: davis mcpherson <davmcphe@cisco.com>
Date:   Tue May 6 08:29:46 2025 -0400

    stream_tcp: deprecate the reassemble_async configuration option

commit a5a8fe2fb28ee6cc33391f1453b5599c3e0928e0
Author: davis mcpherson <davmcphe@cisco.com>
Date:   Mon May 5 23:18:17 2025 -0400

    snort2lua: add include for cstdint to provide standard c++ integer types

src/stream/tcp/tcp_module.cc
src/stream/tcp/tcp_session.cc
src/stream/tcp/tcp_stream_config.cc
src/stream/tcp/tcp_stream_config.h

index fe2d7000e36d5b8068ba07577b139ae68bddee4b..1053f206931ece68155cf65bc12c0f9020ab1ef1 100644 (file)
@@ -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") )
index 915bb29eb68b88d755e4064fca8a2ecd44360b70..b1d0a380b550720b04f1cf8372ec678a01d432f6 100644 (file)
@@ -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);
index 927e0c240eddf922b72d7f28dee845f5c0529950..13f0d1eda191b515948e7f2fb2aad96327bd1c91 100644 (file)
@@ -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 = ";
index 3c0513a9c06f6fd0aaf441ea78f016cd60bddd86..06270e331d2451d4908b3a933c62972bac9e78ef 100644 (file)
@@ -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