mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Detect ip with vlan when falling back to historical data when searching (#7249)
This commit is contained in:
parent
e922d8b3a2
commit
f3eedc7bbc
2 changed files with 21 additions and 1 deletions
|
|
@ -1105,6 +1105,26 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function isHostKey(key)
|
||||
local info = split(key,"@")
|
||||
-- Check format
|
||||
if not info or #info < 1 or #info > 2 then
|
||||
return false
|
||||
end
|
||||
-- Check IP format
|
||||
if isEmptyString(info[1]) or (not isIPv4(info[1]) and not isIPv6(info[1])) then
|
||||
return false
|
||||
end
|
||||
-- Check VLAN format (if any)
|
||||
if not isEmptyString(info[2]) and tonumber(info[2]) == nil then
|
||||
return false
|
||||
end
|
||||
-- Ok
|
||||
return true
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
--
|
||||
-- Analyze the host_info table and return the host key.
|
||||
-- Example:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue