mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Fix stripped @ on host labels
This commit is contained in:
parent
02c36d4140
commit
d392b070a8
1 changed files with 10 additions and 4 deletions
|
|
@ -3045,11 +3045,17 @@ end
|
|||
|
||||
function stripVlan(name)
|
||||
local key = string.split(name, "@")
|
||||
if(key ~= nil) then
|
||||
return(key[1])
|
||||
else
|
||||
return(name)
|
||||
if((key ~= nil) and (#key == 2)) then
|
||||
-- Verify that the host is actually an IP address and the VLAN actually
|
||||
-- a number to avoid stripping things that are not vlans (e.g. part of an host name)
|
||||
local addr = key[1]
|
||||
|
||||
if((tonumber(key[2]) ~= nil) and (isIPv6(addr) or isIPv4(addr))) then
|
||||
return(addr)
|
||||
end
|
||||
end
|
||||
|
||||
return(name)
|
||||
end
|
||||
|
||||
function getSafeChildIcon()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue