From: Jo-Philipp Wich Date: Thu, 27 Oct 2011 00:02:10 +0000 (+0000) Subject: modules/admin-full: don't bother with 4k vlan / no 4k vlan nuisances, simply enable... X-Git-Tag: 0.11.0~1466 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=327e4e773ab303d07d4d4dae43d220af03fc0e62;p=oweals%2Fluci.git modules/admin-full: don't bother with 4k vlan / no 4k vlan nuisances, simply enable it when available --- diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua b/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua index ca1783d29..f16a7a0c6 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua @@ -92,10 +92,6 @@ m.uci:foreach("network", "switch", s:option(Flag, has_vlan, translate("Enable VLAN functionality")) end - if enable_vlan4k then - s:option(Flag, "enable_vlan4k", translate("Enable 4K VLANs")) - end - if has_learn then x = s:option(Flag, has_learn, translate("Enable learning and aging")) x.default = x.enabled @@ -164,11 +160,11 @@ m.uci:foreach("network", "switch", end end) - m.uci:set("network", sid, "device", switch_name) - m.uci:set("network", sid, "vlan", max_nr + 1) + m:set(sid, "device", switch_name) + m:set(sid, "vlan", max_nr + 1) if has_vlan4k then - m.uci:set("network", sid, has_vlan4k, max_id + 1) + m:set(sid, has_vlan4k, max_id + 1) end return sid @@ -244,7 +240,11 @@ m.uci:foreach("network", "switch", end end - m.uci:set("network", section, "ports", table.concat(p, " ")) + if enable_vlan4k then + m:set(sid, "enable_vlan4k", "1") + end + + m:set(section, "ports", table.concat(p, " ")) return Value.write(self, section, value) end