]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #776 in SNORT/snort3 from strtcp to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Sat, 14 Jan 2017 15:12:18 +0000 (10:12 -0500)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Sat, 14 Jan 2017 15:12:18 +0000 (10:12 -0500)
Squashed commit of the following:

commit cc76d85724b799e2727969259dcf9e18603e4742
Author: davis mcpherson <davmcphe.cisco.com>
Date:   Fri Jan 13 07:49:28 2017 -0500

    remove config option that specifies directory for thirdparty appid detection library until third party support is enabled

commit 1b0e15e770db439b5d836ee50a858c69e80dceda
Author: Russ Combs <rucombs@cisco.com>
Date:   Wed Jan 11 12:07:41 2017 -0500

    fix flush issues

    fix getter for tracker flush flags to return uint16_t istead of uint8_t since the flags variable is a uinit16_t

src/network_inspectors/appid/appid_module.cc
src/stream/libtcp/tcp_stream_tracker.h
src/stream/tcp/tcp_reassembler.cc

index daa4814704491b7293cf5a9caaf0fdc5407c19ac..3cdcf3729ade7a57624902faaadbf717f58b902b 100644 (file)
@@ -154,8 +154,10 @@ static const Parameter s_params[] =
       "enable appid debug logging" },
     { "dump_ports", Parameter::PT_BOOL, nullptr, "false",
       "enable dump of appid port information" },
+#ifdef REMOVED_WHILE_NOT_IN_USE
     { "thirdparty_appid_dir", Parameter::PT_STRING, nullptr, nullptr,
       "directory to load thirdparty appid detectors from" },
+#endif
     { "session_log_filter", Parameter::PT_TABLE, session_log_filter, nullptr,
       "session log filter options" },
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
index 7282ba538e8054841dbd8fef1ae0dc58573ad987..cb8979e4d7cb86933b6c1fe9890494b1d93e4a4a 100644 (file)
@@ -278,7 +278,7 @@ public:
         this->ts_last = ts_last;
     }
 
-    uint8_t get_tf_flags() const
+    uint16_t get_tf_flags() const
     {
         return tf_flags;
     }
@@ -409,8 +409,8 @@ protected:
     // FIXIT-L make this protected...
 
 public:
-    uint16_t wscale; /* window scale setting */
-    uint16_t mss; /* max segment size */
+    uint16_t wscale = 0; /* window scale setting */
+    uint16_t mss = 0; /* max segment size */
 };
 
 // <--- note -- the 'state' parameter must be a reference
index 93471bfb82c8810534745f3966568ddb923664ca..080223492b5906b3322214552923a5f12d92667f 100644 (file)
@@ -606,7 +606,7 @@ int TcpReassembler::_flush_to_seq(uint32_t bytes, Packet* p, uint32_t pkt_flags)
     uint32_t bytes_processed = 0;
     uint32_t stop_seq = seglist.next->seq + bytes;
 
-    do
+    while ( seglist.next and SEQ_LT(seglist.next->seq, stop_seq) )
     {
         seglist_base_seq = seglist.next->seq;
         uint32_t footprint = stop_seq - seglist_base_seq;
@@ -675,8 +675,11 @@ int TcpReassembler::_flush_to_seq(uint32_t bytes, Packet* p, uint32_t pkt_flags)
         }
         else
             tracker->clear_tf_flags(TF_MISSING_PREV_PKT);
+
+        // check here instead of in while to allow single segment flushes
+        if ( !flush_data_ready() )
+            break;
     }
-    while ( seglist.next and flush_data_ready( ) );
 
     return bytes_processed;
 }