Make DHCP names cache expire after 1 day

Addresses #3641
This commit is contained in:
emanuele-f 2020-05-08 10:15:31 +02:00
parent ff76407e68
commit d43d4e5e74
7 changed files with 23 additions and 13 deletions

View file

@ -1278,8 +1278,8 @@ end
-- ##############################################
function getDhcpNamesKey(ifid)
return "ntopng.dhcp."..ifid..".cache"
function getDhcpNameKey(ifid, mac)
return string.format("ntopng.dhcp.%d.cache.%s", ifid, mac)
end
-- ##############################################
@ -1344,7 +1344,7 @@ function mac2label(mac)
return(alt_name)
end
alt_name = ntop.getHashCache(getDhcpNamesKey(interface.getId()), mac)
alt_name = ntop.getCache(getDhcpNameKey(interface.getId(), mac))
if not isEmptyString(alt_name) and (alt_name ~= mac) then
return(alt_name)