luci-base: fix ubus luci.getConntrackHelpers call with firewall4
authorJo-Philipp Wich <jo@mein.io>
Fri, 21 Jan 2022 23:28:50 +0000 (00:28 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 21 Jan 2022 23:28:50 +0000 (00:28 +0100)
Fallback to firewall4's helper list if the fw3 one cannot be loaded.
Fixes broken zone configuration when firewall4 is installed as backend.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/root/usr/libexec/rpcd/luci

index 1938e3e9665d1aa09d57c8ffcf8c25d859cb3ddf..dccdbee900db6a111ded6929c440d90148303b20 100755 (executable)
@@ -165,7 +165,11 @@ local methods = {
                        local ok, fd = pcall(io.open, "/usr/share/fw3/helpers.conf", "r")
                        local rv = {}
 
-                       if ok then
+                       if not (ok and fd) then
+                               ok, fd = pcall(io.open, "/usr/share/firewall4/helpers", "r")
+                       end
+
+                       if ok and fd then
                                local entry
 
                                while true do