modules/admin-full: only remove network if zones actually change
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 8 Oct 2009 00:48:02 +0000 (00:48 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 8 Oct 2009 00:48:02 +0000 (00:48 +0000)
modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua

index 37fab9f2bdab5cb568fada694c411d5eee416a6f..db4d500f5b5897cd317dcdd90cf4d09731b88095 100644 (file)
@@ -109,9 +109,6 @@ function fwzone.cfgvalue(self, section)
 end
 
 function fwzone.write(self, section, value)
-
-       fw.del_network(section)
-
        local zone = fw.get_zone(value)
 
        if not zone then
@@ -122,6 +119,7 @@ function fwzone.write(self, section, value)
        end
 
        if zone then
+               fw.del_network(section)
                zone:add_network(section)
        end
 end