Fixed conflict between route.flush(), and namespace-route.flush()

connection_type_change
nathan 2020-08-09 14:44:33 +02:00
parent da0a84256a
commit 27a90021a7
2 changed files with 13 additions and 6 deletions

View File

@ -8,6 +8,17 @@ import java.util.*
*
*/
object NameSpace {
object Route {
fun flush(nameSpace: String) {
if (Common.OS_LINUX) {
run(nameSpace, "/sbin/ip", "route", "flush", "cache")
}
else {
throw RuntimeException("NOT IMPL.")
}
}
}
private val nameSpaceToIifToIp: MutableMap<String, MutableMap<String, String>> = HashMap()
fun add(nameSpace: String) {

View File

@ -6,12 +6,8 @@ import dorkbox.executor.Executor
*
*/
object Route {
fun flush(nameSpace: String) {
if (Common.OS_LINUX) {
NameSpace.run(nameSpace, "/sbin/ip route flush cache")
} else {
throw RuntimeException("NOT IMPL.")
}
fun flush() {
Executor.run("/sbin/ip", "route", "flush", "cache")
}
fun add(targetIpAndCidr: String, hostIP: String, hostInterface: String) {