Add IPv6 addresses to connected devices

This commit is contained in:
Mygod
2018-02-11 01:08:59 -08:00
parent bd34491ad4
commit d70acfa29e
6 changed files with 57 additions and 41 deletions

View File

@@ -101,7 +101,10 @@ class TetheringService : Service(), VpnMonitor.Callback, IpNeighbourMonitor.Call
}
override fun postIpNeighbourAvailable() {
val sizeLookup = neighbours.groupBy { it.dev }.mapValues { (_, neighbours) ->
neighbours.count { it.state != IpNeighbour.State.FAILED }
neighbours
.filter { it.state != IpNeighbour.State.FAILED }
.distinctBy { it.lladdr }
.size
}
ServiceNotification.startForeground(this, routings.keys.associate { Pair(it, sizeLookup[it] ?: 0) })
}