From db30f1e4fb5a8f070c54c0b0742ce63188502122 Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 26 Jun 2020 01:11:45 +0800 Subject: [PATCH] Let the entries be unique --- mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt | 1 + 1 file changed, 1 insertion(+) 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 c1261ffe..abbbfd13 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt @@ -80,6 +80,7 @@ data class IpNeighbour(val ip: InetAddress, val dev: String, val lladdr: MacAddr .asSequence() .filter { parseNumericAddress(it[ARP_IP_ADDRESS]) == ip && it[ARP_DEVICE] == dev } .map { it[ARP_HW_ADDRESS] } + .distinct() .singleOrNull() ?: throw IllegalArgumentException("singleOrNull")) } catch (e: IllegalArgumentException) { Timber.w(e)