Exclude gVisor for unsupported arch

This commit is contained in:
世界 2022-07-17 11:16:13 +08:00
parent 4094c94971
commit cf845d946e
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
6 changed files with 77 additions and 5 deletions

View file

@ -22,7 +22,6 @@ import (
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing-dns"
"github.com/sagernet/sing-tun"
"github.com/sagernet/sing/common"
"github.com/sagernet/sing/common/buf"
"github.com/sagernet/sing/common/bufio"
@ -66,10 +65,10 @@ type Router struct {
transportMap map[string]dns.Transport
interfaceBindManager control.BindManager
networkMonitor tun.NetworkUpdateMonitor
networkMonitor NetworkUpdateMonitor
autoDetectInterface bool
defaultInterface string
interfaceMonitor tun.DefaultInterfaceMonitor
interfaceMonitor DefaultInterfaceMonitor
}
func NewRouter(ctx context.Context, logger log.ContextLogger, dnsLogger log.ContextLogger, options option.RouteOptions, dnsOptions option.DNSOptions) (*Router, error) {
@ -199,7 +198,7 @@ func NewRouter(ctx context.Context, logger log.ContextLogger, dnsLogger log.Cont
router.transportMap = transportMap
if router.interfaceBindManager != nil || options.AutoDetectInterface {
networkMonitor, err := tun.NewNetworkUpdateMonitor(router)
networkMonitor, err := NewNetworkUpdateMonitor(router)
if err == nil {
router.networkMonitor = networkMonitor
if router.interfaceBindManager != nil {
@ -209,7 +208,7 @@ func NewRouter(ctx context.Context, logger log.ContextLogger, dnsLogger log.Cont
}
if router.networkMonitor != nil && options.AutoDetectInterface {
interfaceMonitor, err := tun.NewDefaultInterfaceMonitor(router.networkMonitor, func() {
interfaceMonitor, err := NewDefaultInterfaceMonitor(router.networkMonitor, func() {
router.logger.Info("updated default interface ", router.interfaceMonitor.DefaultInterfaceName(), ", index ", router.interfaceMonitor.DefaultInterfaceIndex())
})
if err != nil {