From f4b8f706fabc3ea63dcdda285f259c81ab49bc5d Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Tue, 21 May 2024 17:19:03 +0530 Subject: [PATCH] flow: use bool wherever possible --- src/flow-hash.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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; } -- 2.47.3