update gvisor
Chore: use "-m mark --mark" instead of "-m owner --uid-owner"
This commit is contained in:
Clash-Mini
2022-02-04 06:11:24 +08:00
parent 176eb3926b
commit 3b277aa8ec
19 changed files with 52 additions and 1981 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt"
"github.com/Dreamacro/clash/listener/inner"
"net"
"os"
"runtime"
"strconv"
"sync"
@ -322,23 +323,50 @@ func ReCreateMixed(port int, tcpIn chan<- C.ConnContext, udpIn chan<- *inbound.P
log.Infoln("Mixed(http+socks) proxy listening at: %s", mixedListener.Address())
}
func ReCreateTun(conf config.Tun, tcpIn chan<- C.ConnContext, udpIn chan<- *inbound.PacketAdapter) error {
//func ReCreateTun(conf config.Tun, tcpIn chan<- C.ConnContext, udpIn chan<- *inbound.PacketAdapter) error {
// tunMux.Lock()
// defer tunMux.Unlock()
//
// if tunAdapter != nil {
// tunAdapter.Close()
// tunAdapter = nil
// }
//
// if !conf.Enable {
// return nil
// }
//
// var err error
// tunAdapter, err = tun.New(conf, tcpIn, udpIn)
//
// return err
//}
func ReCreateTun(conf config.Tun, tcpIn chan<- C.ConnContext, udpIn chan<- *inbound.PacketAdapter) {
tunMux.Lock()
defer tunMux.Unlock()
var err error
defer func() {
if err != nil {
log.Errorln("Start TUN interface error: %s", err.Error())
os.Exit(2)
}
}()
if tunAdapter != nil {
tunAdapter.Close()
tunAdapter = nil
}
if !conf.Enable {
return nil
return
}
var err error
tunAdapter, err = tun.New(conf, tcpIn, udpIn)
return err
if err != nil {
log.Warnln("Failed to start TUN interface: %s", err.Error())
}
}
// GetPorts return the ports of proxy servers