Fixed conflict between route.flush(), and namespace-route.flush()
This commit is contained in:
parent
da0a84256a
commit
27a90021a7
|
@ -8,6 +8,17 @@ import java.util.*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
object NameSpace {
|
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()
|
private val nameSpaceToIifToIp: MutableMap<String, MutableMap<String, String>> = HashMap()
|
||||||
|
|
||||||
fun add(nameSpace: String) {
|
fun add(nameSpace: String) {
|
||||||
|
|
|
@ -6,12 +6,8 @@ import dorkbox.executor.Executor
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
object Route {
|
object Route {
|
||||||
fun flush(nameSpace: String) {
|
fun flush() {
|
||||||
if (Common.OS_LINUX) {
|
Executor.run("/sbin/ip", "route", "flush", "cache")
|
||||||
NameSpace.run(nameSpace, "/sbin/ip route flush cache")
|
|
||||||
} else {
|
|
||||||
throw RuntimeException("NOT IMPL.")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun add(targetIpAndCidr: String, hostIP: String, hostInterface: String) {
|
fun add(targetIpAndCidr: String, hostIP: String, hostInterface: String) {
|
||||||
|
|
Loading…
Reference in New Issue