mirror of
https://github.com/SagerNet/sing-tun.git
synced 2025-04-03 20:07:40 +03:00
Fix darwin monitor
This commit is contained in:
parent
e8633c66d2
commit
8d285f70fb
2 changed files with 16 additions and 4 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"errors"
|
||||
"net"
|
||||
"net/netip"
|
||||
"runtime"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -71,7 +72,9 @@ func (m *defaultInterfaceMonitor) Start() error {
|
|||
}
|
||||
|
||||
func (m *defaultInterfaceMonitor) delayCheckUpdate() {
|
||||
time.Sleep(time.Second)
|
||||
if runtime.GOOS == "android" {
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
err := m.updateInterfaces()
|
||||
if err != nil {
|
||||
m.logger.Error("update interfaces: ", err)
|
||||
|
@ -81,6 +84,8 @@ func (m *defaultInterfaceMonitor) delayCheckUpdate() {
|
|||
m.defaultInterfaceName = ""
|
||||
m.defaultInterfaceIndex = -1
|
||||
m.emit(EventNoRoute)
|
||||
} else if err != nil {
|
||||
m.logger.Error("check interface: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue