Fix DNS update not propagated
This commit is contained in:
@@ -78,15 +78,18 @@ class Routing(val downstream: String, ownerAddress: InterfaceAddress? = null) {
|
|||||||
var dns: List<InetAddress> = emptyList()
|
var dns: List<InetAddress> = emptyList()
|
||||||
|
|
||||||
override fun onAvailable(ifname: String, dns: List<InetAddress>) = synchronized(this@Routing) {
|
override fun onAvailable(ifname: String, dns: List<InetAddress>) = synchronized(this@Routing) {
|
||||||
if (!upstreams.add(ifname)) return
|
|
||||||
val subrouting = subrouting
|
val subrouting = subrouting
|
||||||
if (subrouting == null) this.subrouting = try {
|
when {
|
||||||
Subrouting(this@Routing, priority, ifname)
|
subrouting != null -> check(subrouting.upstream == ifname)
|
||||||
} catch (e: Exception) {
|
!upstreams.add(ifname) -> return
|
||||||
SmartSnackbar.make(e).show()
|
else -> this.subrouting = try {
|
||||||
Timber.w(e)
|
Subrouting(this@Routing, priority, ifname)
|
||||||
null
|
} catch (e: Exception) {
|
||||||
} else check(subrouting.upstream == ifname)
|
SmartSnackbar.make(e).show()
|
||||||
|
Timber.w(e)
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
this.dns = dns
|
this.dns = dns
|
||||||
updateDnsRoute()
|
updateDnsRoute()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user