From: Victor Julien Date: Wed, 18 Sep 2024 07:35:43 +0000 (+0200) Subject: eve/flow: turn error into debug assertion X-Git-Tag: suricata-8.0.0-beta1~874 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51392a6af1f2e59e38a2681388172574fb4e64fc;p=thirdparty%2Fsuricata.git eve/flow: turn error into debug assertion In case this hits logging an error is harmful, better to silently continue. Remove use of `default` to help the compiler flag new enum additions. --- diff --git a/src/output-json-flow.c b/src/output-json-flow.c index 14f62aa004..8172d26d37 100644 --- a/src/output-json-flow.c +++ b/src/output-json-flow.c @@ -252,8 +252,9 @@ static void EveFlowLogJSON(OutputJsonThreadCtx *aft, JsonBuilder *jb, Flow *f) JB_SET_STRING(jb, "bypass", "capture"); break; #endif - default: - SCLogError("Invalid flow state: %d, contact developers", flow_state); + case FLOW_STATE_SIZE: + DEBUG_VALIDATE_BUG_ON(1); + SCLogDebug("invalid flow state: %d, contact developers", flow_state); } const char *reason = NULL;