mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Fixes shortened labels (#7161)
This commit is contained in:
parent
0df02f199c
commit
7ce510a914
1 changed files with 4 additions and 4 deletions
|
|
@ -687,7 +687,7 @@ end
|
|||
-- This function actively resolves an host if there is not information about it.
|
||||
-- NOTE: prefer the host2name on this function
|
||||
function resolveAddress(hostinfo, allow_empty, shorten_len)
|
||||
local alt_name = ip2label(hostinfo["host"], nil, shorten_len)
|
||||
local alt_name = ip2label(hostinfo["host"], hostinfo["vlan"], shorten_len)
|
||||
|
||||
if(not isEmptyString(alt_name) and (alt_name ~= hostinfo["host"])) then
|
||||
-- The host label has priority
|
||||
|
|
@ -701,10 +701,10 @@ function resolveAddress(hostinfo, allow_empty, shorten_len)
|
|||
return hostname
|
||||
else
|
||||
-- this function will take care of formatting the IP
|
||||
return hostinfo2label(hostinfo)
|
||||
return hostinfo2label(hostinfo, true, shorten_len)
|
||||
end
|
||||
end
|
||||
return hostinfo2label(hostinfo)
|
||||
return hostinfo2label(hostinfo, true, shorten_len)
|
||||
end
|
||||
|
||||
-- ###########################################
|
||||
|
|
@ -957,7 +957,7 @@ end
|
|||
|
||||
-- Just a convenience function for hostinfo2label with only IP and VLAN
|
||||
function ip2label(ip, vlan, shorten_len)
|
||||
return hostinfo2label({host = ip, vlan = (vlan or 0)}, false, shorten_len)
|
||||
return hostinfo2label({host = ip, vlan = (vlan or 0)}, true, shorten_len)
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue