Check flags in ARP table for NUD_REACHABLE before assuming a device is online. Fixes #18.

This commit is contained in:
Karsten Nerdinger 2015-01-07 03:36:39 +01:00
parent b63784a4e6
commit fc33273464

View File

@ -101,7 +101,10 @@ class LuciDeviceScanner(object):
result = _req_json_rpc(url, 'net.arptable',
params={'auth': self.token})
if result:
self.last_results = [x['HW address'] for x in result]
self.last_results = []
for x in result:
# Check if the Flags for each device contain NUD_REACHABLE and if so, add it to last_results
if int(x['Flags'], 16) & 0x2: self.last_results.append(x['HW address'])
return True