mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Fixed invalid name access on view interfaces
This commit is contained in:
parent
d67dd50b87
commit
2992d6acd0
1 changed files with 15 additions and 3 deletions
|
|
@ -2345,15 +2345,27 @@ function flow2hostinfo(host_info, host_type)
|
|||
|
||||
if host_type == "cli" then
|
||||
if not host_info["cli.host"] then
|
||||
host_name = interface.getHostMinInfo(host_info["cli.ip"])["name"]
|
||||
local res = interface.getHostMinInfo(host_info["cli.ip"])
|
||||
|
||||
if((res == nil) or (res["name"] == nil)) then
|
||||
host_name = host_info["cli.ip"]
|
||||
else
|
||||
host_name = res["name"]
|
||||
end
|
||||
end
|
||||
|
||||
return({host = host_info["cli.ip"], vlan = host_info["cli.vlan"], name = host_name})
|
||||
elseif host_type == "srv" then
|
||||
if not host_info["srv.host"] then
|
||||
host_name = interface.getHostMinInfo(host_info["srv.ip"])["name"]
|
||||
local res = interface.getHostMinInfo(host_info["srv.ip"])
|
||||
|
||||
if((res == nil) or (res["name"] == nil)) then
|
||||
host_name = host_info["srv.ip"]
|
||||
else
|
||||
host_name = res["name"]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return({host = host_info["srv.ip"], vlan = host_info["srv.vlan"], name = host_name})
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue