fix: compile
This commit is contained in:
parent
1faa172944
commit
708b8beadf
7 changed files with 23 additions and 15 deletions
6
Makefile
6
Makefile
|
@ -47,9 +47,9 @@ WINDOWS_ARCH_LIST = \
|
|||
windows-arm64 \
|
||||
windows-arm32v7
|
||||
|
||||
all:linux-amd64 linux-arm64\
|
||||
darwin-amd64 darwin-arm64\
|
||||
windows-amd64 windows-arm64\
|
||||
all:linux-amd64v3 linux-arm64\
|
||||
darwin-amd64v3 darwin-arm64\
|
||||
windows-amd64v3 windows-arm64\
|
||||
|
||||
docker:
|
||||
GOAMD64=v3 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -127,3 +127,14 @@ func configInterfaceRouting(index int, interfaceName string, ip netip.Addr) erro
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func CleanupRule() {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,3 +61,5 @@ func execRouterCmd(action, inet, route string, interfaceName string) error {
|
|||
_, err := cmd.ExecCmd(fmt.Sprintf("route %s %s %s -interface %s", action, inet, route, interfaceName))
|
||||
return err
|
||||
}
|
||||
|
||||
func CleanupRule() {}
|
||||
|
|
|
@ -103,3 +103,5 @@ func execRouterCmd(action, route, interfaceName, linkIP, table string) error {
|
|||
_, err := cmd.ExecCmd(cmdStr)
|
||||
return err
|
||||
}
|
||||
|
||||
func CleanupRule() {}
|
||||
|
|
|
@ -17,3 +17,5 @@ func GetAutoDetectInterface() (string, error) {
|
|||
func ConfigInterfaceAddress(device.Device, netip.Prefix, int, bool) error {
|
||||
return fmt.Errorf("unsupported on this OS: %s", runtime.GOOS)
|
||||
}
|
||||
|
||||
func CleanupRule() {}
|
||||
|
|
|
@ -269,3 +269,5 @@ func getAutoDetectInterfaceByFamily(family winipcfg.AddressFamily) (string, erro
|
|||
|
||||
return "", errors.New("ethernet interface not found")
|
||||
}
|
||||
|
||||
func CleanupRule() {}
|
||||
|
|
Loading…
Reference in a new issue