@@ -384,9 +384,11 @@ def _update_address_cache(address_cache, line):
matches = re.findall(r"\w*:\w*:\w*:\w*:\w*:\w*", line)
if matches and address_cache.get("last_seen"):
mac_address = matches[0].lower()
- logging.debug("(address cache) Adding cache entry: %s ---> %s",
- mac_address, address_cache.get("last_seen"))
+ if time.time() - address_cache.get("time_%s" % mac_address, 0) > 5:
+ logging.debug("(address cache) Adding cache entry: %s ---> %s",
+ mac_address, address_cache.get("last_seen"))
address_cache[mac_address] = address_cache.get("last_seen")
+ address_cache["time_%s" % mac_address] = time.time()
del address_cache["last_seen"]