mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-25 18:11:28 +00:00
Fix interface monitor
This commit is contained in:
parent
7f816a2ebc
commit
89ff9f8368
|
@ -243,10 +243,9 @@ func NewRouter(ctx context.Context, logger log.ContextLogger, dnsLogger log.Cont
|
||||||
router.transportMap = transportMap
|
router.transportMap = transportMap
|
||||||
router.transportDomainStrategy = transportDomainStrategy
|
router.transportDomainStrategy = transportDomainStrategy
|
||||||
|
|
||||||
needInterfaceMonitor := options.AutoDetectInterface ||
|
needInterfaceMonitor := options.AutoDetectInterface || common.Any(inbounds, func(inbound option.Inbound) bool {
|
||||||
C.IsDarwin && common.Any(inbounds, func(inbound option.Inbound) bool {
|
return inbound.HTTPOptions.SetSystemProxy || inbound.MixedOptions.SetSystemProxy || inbound.TunOptions.AutoRoute
|
||||||
return inbound.HTTPOptions.SetSystemProxy || inbound.MixedOptions.SetSystemProxy || C.IsAndroid && inbound.TunOptions.AutoRoute
|
})
|
||||||
})
|
|
||||||
|
|
||||||
if needInterfaceMonitor {
|
if needInterfaceMonitor {
|
||||||
networkMonitor, err := tun.NewNetworkUpdateMonitor(router)
|
networkMonitor, err := tun.NewNetworkUpdateMonitor(router)
|
||||||
|
|
Loading…
Reference in a new issue