FF-Wizard: Set interface protocol to static, don't add the zone to network if it...
authorSteven Barth <steven@midlink.org>
Sat, 13 Sep 2008 23:21:32 +0000 (23:21 +0000)
committerSteven Barth <steven@midlink.org>
Sat, 13 Sep 2008 23:21:32 +0000 (23:21 +0000)
applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua
applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua

index 5245a92f150537d75e6224e1ba47069ac2854299..cdace2b73e230e974dbd686d4b5a06f642088273 100644 (file)
@@ -178,6 +178,7 @@ function main.write(self, section, value)
        
        -- Crate network interface
        local netconfig = _strip_internals(uci:get_all("freifunk", "interface"))
+       netconfig.proto = "static"
        netconfig.ipaddr = ip
        uci:section("network", "interface", device, netconfig)
        
index bb7cbb83454d8839e864acb9197afcb7b8a4c50f..60a240bf0ca95cc33307d69df0d1e94ded88d23c 100644 (file)
@@ -88,7 +88,8 @@ function firewall_zone_add_interface(name, interface)
        local cursor = uci.cursor()
        local zone = firewall_find_zone(name)
        local net = cursor:get("firewall", zone, "network")
-       cursor:set("firewall", zone, "network", (net or name .. " ") .. interface)
+       local old = net or (cursor:get("network", name) and name)
+       cursor:set("firewall", zone, "network", (old and old .. " " or "") .. interface)
        cursor:save("firewall")
 end