mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-04 12:27:36 +03:00
Exclude gVisor for unsupported arch
This commit is contained in:
parent
4094c94971
commit
cf845d946e
6 changed files with 77 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue