Catch stupid runtimeexceptions
This commit is contained in:
@@ -20,6 +20,7 @@ import kotlinx.coroutines.CancellationException
|
|||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.io.BufferedWriter
|
import java.io.BufferedWriter
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
import java.lang.RuntimeException
|
||||||
import java.net.Inet4Address
|
import java.net.Inet4Address
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
import java.net.NetworkInterface
|
import java.net.NetworkInterface
|
||||||
@@ -206,11 +207,13 @@ class Routing(private val caller: Any, private val downstream: String) : IpNeigh
|
|||||||
val size = dest.address.size
|
val size = dest.address.size
|
||||||
var bestRoute: RouteInfo? = null
|
var bestRoute: RouteInfo? = null
|
||||||
for (route in routes!!) {
|
for (route in routes!!) {
|
||||||
if (route.destination.rawAddress.size == size &&
|
if (route.destination.rawAddress.size == size && (bestRoute == null ||
|
||||||
(bestRoute == null ||
|
bestRoute.destination.prefixLength < route.destination.prefixLength)) {
|
||||||
bestRoute.destination.prefixLength < route.destination.prefixLength) &&
|
try {
|
||||||
route.matches(dest)) {
|
if (route.matches(dest)) bestRoute = route
|
||||||
bestRoute = route
|
} catch (e: RuntimeException) {
|
||||||
|
Timber.w(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dest to bestRoute?.`interface`
|
dest to bestRoute?.`interface`
|
||||||
|
|||||||
Reference in New Issue
Block a user