snort3: fix issue caused by ucode semantics change
authorEric Fahlgren <ericfahlgren@gmail.com>
Fri, 12 Apr 2024 21:21:15 +0000 (14:21 -0700)
committerTianling Shen <cnsztl@gmail.com>
Sat, 13 Apr 2024 05:22:40 +0000 (13:22 +0800)
A recent change in the ucode interpeter caused a failure when using
the 'in' operator.
https://github.com/jow-/ucode/commit/be767ae197babd656d4f5d9c2d5013e39ddbe656

Reported in a forum post by @graysky2.
https://forum.openwrt.org/t/194218/28

Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
net/snort3/Makefile
net/snort3/files/main.uc

index e895399efb7e7b0be971efe441bafa2d953db0c0..907154464ce9b383e51c9a53d07f6ae5106f1073 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=snort3
 PKG_VERSION:=3.1.82.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/snort3/snort3/archive/refs/tags/
index 8e33f9e5d29ed5311e5bba3f6289c010b8690b86..33361f2b1d4598db513b1bdcecf24d0e060d6d95 100644 (file)
@@ -76,6 +76,10 @@ function config_item(type, values, def) {
                wrn(`Invalid item type '${type}', must be one of "enum", "range", "path" or "str".`);
                return;
        }
+       if (type == "enum") {
+               // Convert values to strings, so 'in' works in 'contains'.
+               values = map(values, function(i) { return "" + i; });
+       }
        if (type == "range" && (length(values) != 2 || values[0] > values[1])) {
                wrn(`A 'range' type item must have exactly 2 values in ascending order.`);
                return;