diff options
author | Manuel Munz <freifunk@somakoma.de> | 2012-11-10 20:55:50 +0000 |
---|---|---|
committer | Manuel Munz <freifunk@somakoma.de> | 2012-11-10 20:55:50 +0000 |
commit | 7b7030629c4d55557b368a292d7f3e3d14b1923b (patch) | |
tree | e60dfd01f3e9dff541ab6ad14fda9c2f02aa9667 /modules/admin-full | |
parent | 4e04e353fe91107d27046f93d63aa9aa92418ce8 (diff) |
Add some more datatype checks, patch by Eugene C., #499
Diffstat (limited to 'modules/admin-full')
-rw-r--r-- | modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua | 2 |
1 files changed, 2 insertions, 0 deletions
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", "<div id='portstatus-%s'></div>" % 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. |