applications/luci-ffwizard-leipzig: prepare advanced firewall config and disable...
[project/luci.git] / applications / luci-ffwizard-leipzig / luasrc / model / cbi / ffwizard.lua
index 053df03..6373c7a 100644 (file)
@@ -172,7 +172,7 @@ function main.write(self, section, value)
        uci:save("wireless")
 
        -- Create firewall zone and add default rules (first time)
-       local newzone = tools.firewall_create_zone("freifunk", "DROP", "ACCEPT", "DROP", true)
+       local newzone = tools.firewall_create_zone("freifunk", "REJECT", "ACCEPT", "REJECT", true)
        if newzone then
                uci:foreach("freifunk", "fw_forwarding", function(section)
                        uci:section("firewall", "forwarding", nil, section)
@@ -209,6 +209,16 @@ function main.write(self, section, value)
                        uci:set("firewall", section[".name"], "drop_invalid", "0")
                end)
 
+       -- Prepare advanced config
+       local has_advanced = false
+       uci:foreach("firewall", "advanced",
+               function(section) has_advanced = true end)
+
+       if not has_advanced then
+               uci:section("firewall", "advanced", nil,
+                       { tcp_ecn = "0" })
+       end
+
        uci:save("firewall")