Suppress reporting useless entries
This commit is contained in:
@@ -74,8 +74,9 @@ data class IpNeighbour(val ip: InetAddress, val dev: String, val lladdr: MacAddr
|
||||
}
|
||||
// use ARP as fallback for IPv4, except for INCOMPLETE which by definition does not have arp entry,
|
||||
// or for DELETING, which we do not care about MAC not present
|
||||
if (ip is Inet4Address && lladdr == MacAddressCompat.ALL_ZEROS_ADDRESS && state != State.INCOMPLETE &&
|
||||
state != State.DELETING) try {
|
||||
if (lladdr == MacAddressCompat.ALL_ZEROS_ADDRESS && state != State.INCOMPLETE &&
|
||||
state != State.DELETING) {
|
||||
if (ip is Inet4Address) try {
|
||||
val list = arp()
|
||||
.asSequence()
|
||||
.filter { parseNumericAddress(it[ARP_IP_ADDRESS]) == ip && it[ARP_DEVICE] in devs }
|
||||
@@ -94,6 +95,7 @@ data class IpNeighbour(val ip: InetAddress, val dev: String, val lladdr: MacAddr
|
||||
Timber.d(line)
|
||||
return emptyList()
|
||||
}
|
||||
}
|
||||
devs.map { IpNeighbour(ip, it, lladdr, state) }
|
||||
} catch (e: Exception) {
|
||||
Timber.w(IllegalArgumentException("Unable to parse line: $line", e))
|
||||
|
||||
Reference in New Issue
Block a user