Commit de3ecfd1 authored by Mygod's avatar Mygod

Filter out link local IPv4 addresses in fallback

parent 7100809b
......@@ -82,7 +82,7 @@ sealed class DnsResolverCompat {
printLog(e)
val addresses = Core.connectivity.getLinkProperties(network)?.linkAddresses
true == when (addr) {
is Inet4Address -> addresses?.any { it.address is Inet4Address }
is Inet4Address -> addresses?.any { it.address is Inet4Address && !it.address.isLinkLocalAddress }
is Inet6Address -> addresses?.any {
it.address.run { this is Inet6Address && !isLinkLocalAddress && !isIPv4CompatibleAddress }
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment