From 2047e02ec78c94be018734ec62868b9caffd3246 Mon Sep 17 00:00:00 2001 From: Mygod Date: Tue, 7 Jul 2020 03:35:11 +0800 Subject: [PATCH] Refine shouldSuppressIpError --- mobile/src/main/java/be/mygod/vpnhotspot/net/Routing.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/Routing.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/Routing.kt index 2ba7bba7..7c224b43 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/Routing.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/Routing.kt @@ -92,11 +92,11 @@ class Routing(private val caller: Any, private val downstream: String) : IpNeigh } fun shouldSuppressIpError(e: RoutingCommands.UnexpectedOutputException, isAdd: Boolean = true) = - e.result.out.isEmpty() && (e.result.exit == 2 || e.result.exit == 254) && e.result.err == if (isAdd) { - "RTNETLINK answers: File exists\n" + e.result.out.isEmpty() && (e.result.exit == 2 || e.result.exit == 254) && if (isAdd) { + "RTNETLINK answers: File exists" } else { - "RTNETLINK answers: No such file or directory\n" - } + "RTNETLINK answers: No such file or directory" + } == e.result.err.trim() } private fun RootSession.Transaction.ipRule(add: String, priority: Int, rule: String = "", del: String = add) {