From 840ccdeeabce16e9f1f53390d870992ad372b967 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 5 Aug 2023 00:46:47 +0200 Subject: [PATCH] fw4: avoid emitting invalid rule jump targets Avoid emitting a bogus chain jump for actionless rules bound to a log-enabled source zone. Fixes: https://github.com/openwrt/firewall4/issues/5 Signed-off-by: Jo-Philipp Wich --- root/usr/share/ucode/fw4.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/usr/share/ucode/fw4.uc b/root/usr/share/ucode/fw4.uc index 06ef932..cba7b02 100644 --- a/root/usr/share/ucode/fw4.uc +++ b/root/usr/share/ucode/fw4.uc @@ -2380,7 +2380,7 @@ return { } } - let need_src_action_chain = (rule) => (rule.src?.zone?.log && rule.target != "accept"); + let need_src_action_chain = (rule) => (rule.src?.zone?.log && rule.target && rule.target != "accept"); let add_rule = (family, proto, saddrs, daddrs, sports, dports, icmptypes, icmpcodes, ipset, rule) => { let r = { -- 2.30.2