]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/ip.src: Allow use with transforms
authorJeff Lucovsky <jeff.lucovsky@corelight.com>
Wed, 22 Oct 2025 14:38:08 +0000 (10:38 -0400)
committerVictor Julien <vjulien@oisf.net>
Wed, 29 Oct 2025 15:33:52 +0000 (15:33 +0000)
This commit registers ip.src/ip.dst properly so they can be used with
transforms.

Issue: 8015

src/detect-ipaddr.c

index a3d2c6b4c8720b5f69e2fe8d3a7d2adcd55e2626..ab2335fc5acc3542869e82a8956ca51c163843b7 100644 (file)
@@ -30,6 +30,7 @@
 #include "detect.h"
 #include "detect-parse.h"
 #include "detect-engine.h"
+#include "detect-engine-buffer.h"
 #include "detect-engine-mpm.h"
 #include "detect-engine-prefilter.h"
 #include "detect-ipaddr.h"
@@ -96,7 +97,8 @@ static int DetectSrcIPAddrBufferSetup(DetectEngineCtx *de_ctx, Signature *s, con
 {
     /* store list id. Content, pcre, etc will be added to the list at this
      * id. */
-    s->init_data->list = g_src_ipaddr_buffer_id;
+    if (SCDetectBufferSetActiveList(de_ctx, s, g_src_ipaddr_buffer_id) < 0)
+        return -1;
 
     return 0;
 }
@@ -105,7 +107,8 @@ static int DetectDestIPAddrBufferSetup(DetectEngineCtx *de_ctx, Signature *s, co
 {
     /* store list id. Content, pcre, etc will be added to the list at this
      * id. */
-    s->init_data->list = g_dest_ipaddr_buffer_id;
+    if (SCDetectBufferSetActiveList(de_ctx, s, g_dest_ipaddr_buffer_id) < 0)
+        return -1;
 
     return 0;
 }