From: Eric Fahlgren Date: Fri, 12 Apr 2024 21:21:15 +0000 (-0700) Subject: snort3: fix issue caused by ucode semantics change X-Git-Url: http://git.openwrt.org/?p=feed%2Fpackages.git;a=commitdiff_plain;h=4ce2d741c6d7619cd66539668fa148bc16aa78d9 snort3: fix issue caused by ucode semantics change 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 --- diff --git a/net/snort3/Makefile b/net/snort3/Makefile index e895399efb..907154464c 100644 --- a/net/snort3/Makefile +++ b/net/snort3/Makefile @@ -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/ diff --git a/net/snort3/files/main.uc b/net/snort3/files/main.uc index 8e33f9e5d2..33361f2b1d 100644 --- a/net/snort3/files/main.uc +++ b/net/snort3/files/main.uc @@ -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;