fix: compile

This commit is contained in:
adlyq
2022-05-29 20:00:38 +08:00
parent 1faa172944
commit 708b8beadf
7 changed files with 23 additions and 15 deletions

View File

@ -4,9 +4,7 @@ import (
"fmt"
"github.com/Dreamacro/clash/listener/inner"
"github.com/Dreamacro/clash/listener/tun/ipstack/commons"
"github.com/vishvananda/netlink"
"net"
"runtime"
"sort"
"strconv"
"sync"
@ -456,16 +454,7 @@ func Cleanup(wait bool) {
commons.WaitForTunClose(lastTunConf.Device)
}
if runtime.GOOS == "android" {
r := netlink.NewRule()
for i := 0; i < 5; i++ {
r.Priority = 9000 + i*10
err := netlink.RuleDel(r)
if err != nil {
log.Warnln("[TOUTE] cleanup route rule: %s", err)
}
}
}
commons.CleanupRule()
}
tunStackListener = nil
lastTunConf = nil