From b69a2b1ebab27ca9fa35879027933f9e96d397c7 Mon Sep 17 00:00:00 2001 From: Mygod Date: Tue, 23 Jun 2020 07:41:58 +0800 Subject: [PATCH] Suppress reporting for illegal states --- mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt index 04c627e0..c1261ffe 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt @@ -68,7 +68,9 @@ data class IpNeighbour(val ip: InetAddress, val dev: String, val lladdr: MacAddr if (match.groups[4] != null) try { lladdr = MacAddressCompat.fromString(match.groupValues[5]) } catch (e: IllegalArgumentException) { - Timber.w(IOException("Failed to find MAC address for $line", e)) + if (state != State.INCOMPLETE && state != State.DELETING) { + Timber.w(IOException("Failed to find MAC address for $line", e)) + } } // 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