]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3867: stream ip: Fix session counters in timeout and cleanup cases
authorSteven Baigal (sbaigal) <sbaigal@cisco.com>
Fri, 9 Jun 2023 15:05:48 +0000 (15:05 +0000)
committerSteven Baigal (sbaigal) <sbaigal@cisco.com>
Fri, 9 Jun 2023 15:05:48 +0000 (15:05 +0000)
Merge in SNORT/snort3 from ~CHSHERWI/snort3:ip_counters2 to master

Squashed commit of the following:

commit 744d42e3c0424f5b49f76ce9b7e30a136fd1f1ed
Author: Chris Sherwin <chsherwi@cisco.com>
Date:   Mon Jun 5 10:54:04 2023 -0400

    stream ip: Fix session counters in timeout and cleanup cases

src/stream/ip/ip_session.cc

index 2bf51536ca06ef8ef6068fcd2208fccec0c3c5d4..d9034e40c9020123cf049e081b411fcdc80a2fb3 100644 (file)
@@ -79,7 +79,9 @@ static void IpSessionCleanup(Flow* lws, FragTracker* tracker)
         d->cleanup(tracker);
     }
 
-    ip_stats.released++;
+    if ( lws->ssn_state.session_flags & SSNFLAG_SEEN_SENDER )
+        ip_stats.released++;
+
     lws->restart();
 }
 
@@ -178,6 +180,7 @@ int IpSession::process(Packet* p)
     {
         ip_stats.timeouts++;
         IpSessionCleanup(flow, &tracker);
+        ip_stats.created++;
 
 #ifdef ENABLE_EXPECTED_IP
         if ( Stream::expected_flow(flow, p) )