]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fix flow_con and icmp counts
authorRuss Combs <rucombs@cisco.com>
Mon, 10 Nov 2014 11:27:40 +0000 (06:27 -0500)
committerRuss Combs <rucombs@cisco.com>
Mon, 10 Nov 2014 11:27:40 +0000 (06:27 -0500)
ChangeLog
src/stream/base/stream_base.cc
src/stream/icmp/icmp_session.cc

index 7b5c3d15bd2dfb70c713939d862cb58c428a8188..601b79fc649bb8a7a29d13ab4e34e12f3b33a417 100644 (file)
--- 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
index 7e5e0776b65d603174be7426b5a19b06a265500f..565d3cf0c14bae085b596732c62b82b94d56849c 100644 (file)
@@ -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));
 }
 
index 43af19929f0eb003fdbc7b52857842fd233016b2..ac7cff8231fbd28f88e13edbf8a7eb1d38ab1167 100644 (file)
@@ -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)