fw4: honour enabled option of include sections
authorJo-Philipp Wich <jo@mein.io>
Mon, 8 Aug 2022 18:57:33 +0000 (20:57 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 8 Aug 2022 19:09:12 +0000 (21:09 +0200)
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>
root/usr/share/ucode/fw4.uc

index cdc6e94bebc04cc9c766938d8159d6b4b23bceb6..2dc44ac9684b44e90754a0fda1a66f90c5899079 100644 (file)
@@ -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");