Merge pull request #1791 from dibdot/travelmate

luci-app-travelmate: fix Interface Wizard
This commit is contained in:
Dirk Brenken 2018-05-11 20:15:20 +02:00 committed by GitHub
commit e951a4dd90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,12 +41,14 @@ if uplink == "" then
function o.validate(self, value) function o.validate(self, value)
if value then if value then
local net = nw:add_network(value, { proto = "dhcp" }) local nwnet = nw:get_network(value)
if net then local zone = fw:get_zone("wan")
local zone = fw:get_zone_by_network("wan") local fwnet = fw:get_zone_by_network(value)
if zone then if not nwnet then
zone:add_network(value) nwnet = nw:add_network(value, { proto = "dhcp" })
end end
if zone and not fwnet then
fwnet = zone:add_network(value)
end end
end end
return value return value