]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4703: flow: don't offset flow instance number by 1 when printing flows
authorMichael Matirko (mmatirko) <mmatirko@cisco.com>
Mon, 28 Apr 2025 15:13:22 +0000 (15:13 +0000)
committerSteven Baigal (sbaigal) <sbaigal@cisco.com>
Mon, 28 Apr 2025 15:13:22 +0000 (15:13 +0000)
Merge in SNORT/snort3 from ~MMATIRKO/snort3:flow_off_by_one to master

Squashed commit of the following:

commit 3a644db3963d2fef5638e7b30a792d85fd9abe30
Author: Michael Matirko <mmatirko@cisco.com>
Date:   Tue Apr 15 12:46:20 2025 -0400

    flow: don't offset flow instance number by 1 when printing flows

src/flow/flow_cache.cc

index 238426522c88fca1508eb50997fbf06a14009dfd..53b34ff1f7c1b35ea363063b4fb9c35e4c893568 100644 (file)
@@ -964,16 +964,16 @@ void FlowCache::output_flow(std::fstream& stream, const Flow& flow, const struct
     switch ( flow.key->pkt_type )
     {
         case PktType::IP:
-            out << "Instance-ID: " << get_relative_instance_number() + 1<< " IP " << flow.key->addressSpaceId << ": " << src_ip << " " << dst_ip;
+            out << "Instance-ID: " << get_relative_instance_number() << " IP " << flow.key->addressSpaceId << ": " << src_ip << " " << dst_ip;
             break;
 
         case PktType::ICMP:
-            out << "Instance-ID: " << get_relative_instance_number() + 1 << " ICMP " << flow.key->addressSpaceId << ": " << src_ip << " type " << src_port << " "
+            out << "Instance-ID: " << get_relative_instance_number() << " ICMP " << flow.key->addressSpaceId << ": " << src_ip << " type " << src_port << " "
                 << dst_ip;
             break;
 
         case PktType::TCP:
-            out << "Instance-ID: " << get_relative_instance_number() + 1 << " TCP " << flow.key->addressSpaceId << ": " << src_ip << "/" << src_port << " "
+            out << "Instance-ID: " << get_relative_instance_number() << " TCP " << flow.key->addressSpaceId << ": " << src_ip << "/" << src_port << " "
                 << dst_ip << "/" << dst_port;
             if (flow.session)
             {
@@ -984,7 +984,7 @@ void FlowCache::output_flow(std::fstream& stream, const Flow& flow, const struct
             break;
 
         case PktType::UDP:
-            out << "Instance-ID: " << get_relative_instance_number() + 1 << " UDP " << flow.key->addressSpaceId << ": "<< src_ip << "/" << src_port << " "
+            out << "Instance-ID: " << get_relative_instance_number() << " UDP " << flow.key->addressSpaceId << ": "<< src_ip << "/" << src_port << " "
                 << dst_ip << "/" << dst_port;
             break;