mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 00:40:10 +00:00
Improved port validation
This commit is contained in:
parent
e57cfbfbc7
commit
6db11c6aab
1 changed files with 16 additions and 0 deletions
|
|
@ -229,6 +229,22 @@ local function validateInterfaceType(p)
|
|||
end
|
||||
|
||||
local function validatePort(p)
|
||||
local items = split(p, "/")
|
||||
|
||||
if(items == nil) then
|
||||
return false
|
||||
else
|
||||
p = items[1]
|
||||
|
||||
if(items[2] ~= nil) then
|
||||
if((items[2] == "tcp") or (items[2] == "udp")) then
|
||||
-- Good: example 80/tcp
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not validateNumber(p) then
|
||||
return false
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue