summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich2022-08-08 18:57:33 +0000
committerJo-Philipp Wich2022-08-08 19:09:12 +0000
commitca7e3a1ab6798581ecdcd5f1df991fe355a265b4 (patch)
tree07e161b464768efe689067b86c876cffd7edf702
parent5a02f74ec3bcf34881e6b8b64f7c36303f732e00 (diff)
downloadfirewall4-ca7e3a1ab6798581ecdcd5f1df991fe355a265b4.tar.gz
fw4: honour enabled option of include sections
The `enabled` bool option was parsed but not acted upon. Fix the issue by adding the appropriate return statement. Ref: https://forum.openwrt.org/t/firewall4/113704/112 Fixes: 11256ff ("fw4: add support for configurable includes") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--root/usr/share/ucode/fw4.uc5
1 files changed, 5 insertions, 0 deletions
diff --git a/root/usr/share/ucode/fw4.uc b/root/usr/share/ucode/fw4.uc
index cdc6e94..2dc44ac 100644
--- a/root/usr/share/ucode/fw4.uc
+++ b/root/usr/share/ucode/fw4.uc
@@ -3107,6 +3107,11 @@ return {
chain: [ "string" ]
});
+ if (!inc.enabled) {
+ this.warn_section(data, "is disabled, ignoring section");
+ return;
+ }
+
if (inc.type == "script" && !inc.fw4_compatible) {
this.warn_section(data, "is not marked as compatible with fw4, ignoring section");
this.warn_section(data, "requires 'option fw4_compatible 1' to be considered compatible");