From: Jo-Philipp Wich Date: Sat, 4 Jan 2020 17:46:04 +0000 (+0100) Subject: luci-app-firewall: fix zone network default X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=71c80a03ce7f6671f2e91a7cae1ccb8e78e24f6a;p=oweals%2Fluci.git luci-app-firewall: fix zone network default When a `config zone` section lacks an `option network` or `list network` setting, its contained interface list defaults to the name of the zone, e.g. a zone named `foo` will implicitely contain the network `foo` unless a deviating or empty `option network` is specified. Adjust the zones.js model accordingly to reflect that implicit default. Signed-off-by: Jo-Philipp Wich (cherry picked from commit d60a1a13b091c622bc2d4d63321d2e3ea0437796) --- diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js index 8bf8d0486..4f8dad23d 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js @@ -137,6 +137,9 @@ return L.view.extend({ o = s.taboption('general', widgets.NetworkSelect, 'network', _('Covered networks')); o.modalonly = true; o.multiple = true; + o.cfgvalue = function(section_id) { + return uci.get('firewall', section_id, 'network') || uci.get('firewall', section_id, 'name'); + }; o.write = function(section_id, formvalue) { var name = uci.get('firewall', section_id, 'name'), cfgvalue = this.cfgvalue(section_id);