FF-Wizard: Set interface protocol to static, don't add the zone to network if it does not match an existing interface

This commit is contained in:
Steven Barth 2008-09-13 23:21:32 +00:00
parent 8bba6cf4d0
commit 1665418366
2 changed files with 3 additions and 1 deletions

View 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)

View 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