]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/ike.vendor: update buffer initialization logic
authorVictor Julien <vjulien@oisf.net>
Sat, 28 Jan 2023 10:26:46 +0000 (11:26 +0100)
committerVictor Julien <vjulien@oisf.net>
Sat, 28 Jan 2023 11:46:41 +0000 (12:46 +0100)
src/detect-ike-vendor.c

index 4c4be8f1a98ed87f6b8e453b6c28b6a317f5b70e..c0d57de346fe0d693e0fdc4b3640186a591ce830 100644 (file)
@@ -56,7 +56,7 @@ static int g_ike_vendor_buffer_id = 0;
 
 static InspectionBuffer *IkeVendorGetData(DetectEngineThreadCtx *det_ctx,
         const DetectEngineTransforms *transforms, Flow *f, struct IkeVendorGetDataArgs *cbdata,
-        int list_id, bool first)
+        int list_id)
 {
     SCEnter();
 
@@ -64,7 +64,7 @@ static InspectionBuffer *IkeVendorGetData(DetectEngineThreadCtx *det_ctx,
             InspectionBufferMultipleForListGet(det_ctx, list_id, cbdata->local_id);
     if (buffer == NULL)
         return NULL;
-    if (!first && buffer->inspect != NULL)
+    if (buffer->initialized)
         return buffer;
 
     const uint8_t *data;
@@ -98,8 +98,7 @@ static void PrefilterTxIkeVendor(DetectEngineThreadCtx *det_ctx, const void *pec
     uint32_t local_id = 0;
     while (1) {
         struct IkeVendorGetDataArgs cbdata = { local_id, txv };
-        InspectionBuffer *buffer =
-                IkeVendorGetData(det_ctx, ctx->transforms, f, &cbdata, list_id, true);
+        InspectionBuffer *buffer = IkeVendorGetData(det_ctx, ctx->transforms, f, &cbdata, list_id);
         if (buffer == NULL)
             break;
 
@@ -151,7 +150,7 @@ static uint8_t DetectEngineInspectIkeVendor(DetectEngineCtx *de_ctx, DetectEngin
             txv,
         };
         InspectionBuffer *buffer =
-                IkeVendorGetData(det_ctx, transforms, f, &cbdata, engine->sm_list, false);
+                IkeVendorGetData(det_ctx, transforms, f, &cbdata, engine->sm_list);
         if (buffer == NULL || buffer->inspect == NULL)
             break;