Refine shouldSuppressIpError
This commit is contained in:
@@ -92,11 +92,11 @@ class Routing(private val caller: Any, private val downstream: String) : IpNeigh
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun shouldSuppressIpError(e: RoutingCommands.UnexpectedOutputException, isAdd: Boolean = true) =
|
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) {
|
e.result.out.isEmpty() && (e.result.exit == 2 || e.result.exit == 254) && if (isAdd) {
|
||||||
"RTNETLINK answers: File exists\n"
|
"RTNETLINK answers: File exists"
|
||||||
} else {
|
} 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) {
|
private fun RootSession.Transaction.ipRule(add: String, priority: Int, rule: String = "", del: String = add) {
|
||||||
|
|||||||
Reference in New Issue
Block a user