Fix: should flush interface cache by switch network
This commit is contained in:
parent
7a406b991e
commit
5642d9c98e
@ -7,6 +7,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Dreamacro/clash/component/dialer"
|
"github.com/Dreamacro/clash/component/dialer"
|
||||||
|
"github.com/Dreamacro/clash/component/iface"
|
||||||
"github.com/Dreamacro/clash/log"
|
"github.com/Dreamacro/clash/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -61,6 +62,8 @@ func StartDefaultInterfaceChangeMonitor() {
|
|||||||
|
|
||||||
dialer.DefaultInterface.Store(interfaceName)
|
dialer.DefaultInterface.Store(interfaceName)
|
||||||
|
|
||||||
|
iface.FlushCache()
|
||||||
|
|
||||||
log.Warnln("[TUN] default interface changed by monitor, %s => %s", old, interfaceName)
|
log.Warnln("[TUN] default interface changed by monitor, %s => %s", old, interfaceName)
|
||||||
case <-monitorStop:
|
case <-monitorStop:
|
||||||
break
|
break
|
||||||
|
Reference in New Issue
Block a user