From: Dirk Brenken Date: Fri, 11 May 2018 09:00:16 +0000 (+0200) Subject: luci-app-travelmate: fix Interface Wizard X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=refs%2Fpull%2F1791%2Fhead;p=project%2Fluci.git luci-app-travelmate: fix Interface Wizard * make sure to update the nw & fw entries only once Signed-off-by: Dirk Brenken --- diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua index f8846493e7..a1dcbc638c 100644 --- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua +++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua @@ -41,12 +41,14 @@ if uplink == "" then function o.validate(self, value) if value then - local net = nw:add_network(value, { proto = "dhcp" }) - if net then - local zone = fw:get_zone_by_network("wan") - if zone then - zone:add_network(value) - end + local nwnet = nw:get_network(value) + local zone = fw:get_zone("wan") + local fwnet = fw:get_zone_by_network(value) + if not nwnet then + nwnet = nw:add_network(value, { proto = "dhcp" }) + end + if zone and not fwnet then + fwnet = zone:add_network(value) end end return value