]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow: use bool wherever possible
authorShivani Bhardwaj <shivani@oisf.net>
Tue, 21 May 2024 11:49:03 +0000 (17:19 +0530)
committerVictor Julien <victor@inliniac.net>
Wed, 22 May 2024 04:45:11 +0000 (06:45 +0200)
src/flow-hash.c

index 3bec26f1761d9aa97e53d8e875cd7526a39fc29e..02f084374258f3f5b2217bc8f792c0068bea9070 100644 (file)
@@ -542,10 +542,10 @@ static inline int FlowCompare(Flow *f, const Packet *p)
  *  - TCP flags (emergency mode only)
  *
  *  \param p packet
- *  \retval true
- *  \retval false
+ *  \retval true
+ *  \retval false
  */
-static inline int FlowCreateCheck(const Packet *p, const bool emerg)
+static inline bool FlowCreateCheck(const Packet *p, const bool emerg)
 {
     /* if we're in emergency mode, don't try to create a flow for a TCP
      * that is not a TCP SYN packet. */
@@ -556,18 +556,18 @@ static inline int FlowCreateCheck(const Packet *p, const bool emerg)
                     !stream_config.midstream) {
                 ;
             } else {
-                return 0;
+                return false;
             }
         }
     }
 
     if (PacketIsICMPv4(p)) {
         if (ICMPV4_IS_ERROR_MSG(p->icmp_s.type)) {
-            return 0;
+            return false;
         }
     }
 
-    return 1;
+    return true;
 }
 
 static inline void FlowUpdateCounter(ThreadVars *tv, DecodeThreadVars *dtv,
@@ -684,7 +684,7 @@ static Flow *FlowGetNew(ThreadVars *tv, FlowLookupStruct *fls, Packet *p)
         return NULL;
     }
 #endif
-    if (FlowCreateCheck(p, emerg) == 0) {
+    if (!FlowCreateCheck(p, emerg)) {
         return NULL;
     }