From: Russ Combs (rucombs) Date: Sat, 14 Jan 2017 15:12:18 +0000 (-0500) Subject: Merge pull request #776 in SNORT/snort3 from strtcp to master X-Git-Tag: 3.0.0-233~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=308c5a3a2c1e60c548f5cddb0f232d844a7d9bee;p=thirdparty%2Fsnort3.git Merge pull request #776 in SNORT/snort3 from strtcp to master Squashed commit of the following: commit cc76d85724b799e2727969259dcf9e18603e4742 Author: davis mcpherson 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 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 --- diff --git a/src/network_inspectors/appid/appid_module.cc b/src/network_inspectors/appid/appid_module.cc index daa481470..3cdcf3729 100644 --- a/src/network_inspectors/appid/appid_module.cc +++ b/src/network_inspectors/appid/appid_module.cc @@ -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 } diff --git a/src/stream/libtcp/tcp_stream_tracker.h b/src/stream/libtcp/tcp_stream_tracker.h index 7282ba538..cb8979e4d 100644 --- a/src/stream/libtcp/tcp_stream_tracker.h +++ b/src/stream/libtcp/tcp_stream_tracker.h @@ -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 diff --git a/src/stream/tcp/tcp_reassembler.cc b/src/stream/tcp/tcp_reassembler.cc index 93471bfb8..080223492 100644 --- a/src/stream/tcp/tcp_reassembler.cc +++ b/src/stream/tcp/tcp_reassembler.cc @@ -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; }