From 7b7030629c4d55557b368a292d7f3e3d14b1923b Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Sat, 10 Nov 2012 20:55:50 +0000 Subject: Add some more datatype checks, patch by Eugene C., #499 --- modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/admin-full/luasrc/model') 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 b0de19133d..0fa2696e8a 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua @@ -202,10 +202,12 @@ m.uci:foreach("network", "switch", local vid = s:option(Value, has_vlan4k or "vlan", "VLAN ID", "
" % switch_name) + local mx_vid = has_vlan4k and 4094 or (num_vlans - 1) vid.rmempty = false vid.forcewrite = true vid.vlan_used = { } + vid.datatype = "and(uinteger,range("..min_vid..","..mx_vid.."))" -- Validate user provided VLAN ID, make sure its within the bounds -- allowed by the switch. -- cgit v1.2.3