From 72841be050714d90b5bc34de7ac91917a9f571b5 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 3 Jan 2024 10:44:09 +0100 Subject: [PATCH] detect/rule-header: minor code cleanups --- src/detect.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/detect.c b/src/detect.c index 7aff832409..73ff82a827 100644 --- a/src/detect.c +++ b/src/detect.c @@ -587,10 +587,9 @@ static inline int DetectRunInspectRuleHeader( if ((p->flags & PKT_HAS_FLOW) && (sflags & SIG_FLAG_REQUIRE_FLOWVAR)) { DEBUG_VALIDATE_BUG_ON(f == NULL); - int m = f->flowvar ? 1 : 0; - /* no flowvars? skip this sig */ - if (m == 0) { + const bool fv = f->flowvar != NULL; + if (fv == false) { SCLogDebug("skipping sig as the flow has no flowvars and sig " "has SIG_FLAG_REQUIRE_FLOWVAR flag set."); return 0; @@ -616,7 +615,7 @@ static inline int DetectRunInspectRuleHeader( if (!(sflags & SIG_FLAG_DP_ANY)) { if (p->flags & PKT_IS_FRAGMENT) return 0; - DetectPort *dport = DetectPortLookupGroup(s->dp,p->dp); + const DetectPort *dport = DetectPortLookupGroup(s->dp, p->dp); if (dport == NULL) { SCLogDebug("dport didn't match."); return 0; @@ -625,7 +624,7 @@ static inline int DetectRunInspectRuleHeader( if (!(sflags & SIG_FLAG_SP_ANY)) { if (p->flags & PKT_IS_FRAGMENT) return 0; - DetectPort *sport = DetectPortLookupGroup(s->sp,p->sp); + const DetectPort *sport = DetectPortLookupGroup(s->sp, p->sp); if (sport == NULL) { SCLogDebug("sport didn't match."); return 0; -- 2.47.2