]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow: optimize Flow structure layout
authorVictor Julien <victor@inliniac.net>
Sun, 26 Nov 2017 09:30:47 +0000 (10:30 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 27 Nov 2017 07:00:59 +0000 (08:00 +0100)
Shrink structure with 8 bytes by moving new ttl fields into an
existing 'gap'.

Also fixes a strange ASAN issue in GCC 5.4.0 in unittests.

src/flow.h

index f969c7a5ea4d1457ecc4c4ecb2f02ce01cb7d772..f2aa47df014894518f40d1393b75d0a59b3ca784 100644 (file)
@@ -331,10 +331,6 @@ typedef struct Flow_
     uint8_t proto;
     uint8_t recursion_level;
     uint16_t vlan_id[2];
-    uint8_t min_ttl_toserver;
-    uint8_t max_ttl_toserver;
-    uint8_t min_ttl_toclient;
-    uint8_t max_ttl_toclient;
 
     /** flow hash - the flow hash before hash table size mod. */
     uint32_t flow_hash;
@@ -409,6 +405,12 @@ typedef struct Flow_
     /** Thread ID for the stream/detect portion of this flow */
     FlowThreadId thread_id;
 
+    /** ttl tracking */
+    uint8_t min_ttl_toserver;
+    uint8_t max_ttl_toserver;
+    uint8_t min_ttl_toclient;
+    uint8_t max_ttl_toclient;
+
     /** application level storage ptrs.
      *
      */