From: Steven Barth Date: Sat, 13 Sep 2008 23:21:32 +0000 (+0000) Subject: FF-Wizard: Set interface protocol to static, don't add the zone to network if it... X-Git-Tag: 0.9.0~1320 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=16654183664f14a7c6be0ca701c693c301a93321;hp=8bba6cf4d061e28d8fda10a6f9348fa8a8b1380e FF-Wizard: Set interface protocol to static, don't add the zone to network if it does not match an existing interface --- diff --git a/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua b/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua index 5245a92f1..cdace2b73 100644 --- a/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua +++ b/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua @@ -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) diff --git a/applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua b/applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua index bb7cbb834..60a240bf0 100644 --- a/applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua +++ b/applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua @@ -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