From: Shivani Bhardwaj Date: Tue, 21 May 2024 11:49:03 +0000 (+0530) Subject: flow: use bool wherever possible X-Git-Tag: suricata-8.0.0-beta1~1290 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4b8f706fabc3ea63dcdda285f259c81ab49bc5d;p=thirdparty%2Fsuricata.git flow: use bool wherever possible --- diff --git a/src/flow-hash.c b/src/flow-hash.c index 3bec26f176..02f0843742 100644 --- a/src/flow-hash.c +++ b/src/flow-hash.c @@ -542,10 +542,10 @@ static inline int FlowCompare(Flow *f, const Packet *p) * - TCP flags (emergency mode only) * * \param p packet - * \retval 1 true - * \retval 0 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; }