From: Russ Combs Date: Mon, 10 Nov 2014 11:27:40 +0000 (-0500) Subject: fix flow_con and icmp counts X-Git-Tag: 3.0.0-233~1245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da8d810a345d7effcd281312537a69f915994ed5;p=thirdparty%2Fsnort3.git fix flow_con and icmp counts --- diff --git a/ChangeLog b/ChangeLog index 7b5c3d15b..601b79fc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ -- fixed implied equal range checks (ie just a #, no op) -- fixed !content -- support \xFF style hex chars in content strings +-- fix icmp session cleanup counting +-- fix null flow_con in print mode 127 -- REG_TEST out logging tcp options for rebuilt packets to match snort bug diff --git a/src/stream/base/stream_base.cc b/src/stream/base/stream_base.cc index 7e5e0776b..565d3cf0c 100644 --- a/src/stream/base/stream_base.cc +++ b/src/stream/base/stream_base.cc @@ -91,6 +91,9 @@ static const char* const base_pegs[] = void base_sum() { + if ( !flow_con ) + return; + t_stats.tcp_flows = flow_con->get_flows(IPPROTO_TCP); t_stats.tcp_prunes = flow_con->get_prunes(IPPROTO_TCP); @@ -115,7 +118,9 @@ void base_stats() void base_reset() { - flow_con->clear_counts(); + if ( flow_con ) + flow_con->clear_counts(); + memset(&t_stats, 0, sizeof(t_stats)); } diff --git a/src/stream/icmp/icmp_session.cc b/src/stream/icmp/icmp_session.cc index 43af19929..ac7cff823 100644 --- a/src/stream/icmp/icmp_session.cc +++ b/src/stream/icmp/icmp_session.cc @@ -70,10 +70,10 @@ static void IcmpSessionCleanup(Flow *ssn) CloseStreamSession(&sfBase, SESSION_CLOSED_NORMALLY); } - ssn->clear(); - if ( ssn->s5_state.session_flags & SSNFLAG_SEEN_SENDER ) icmpStats.released++; + + ssn->clear(); } static int ProcessIcmpUnreach(Packet *p)