From 5642d9c98eadf864fc4f23636c654d2dd1477f17 Mon Sep 17 00:00:00 2001 From: yaling888 <73897884+yaling888@users.noreply.github.com> Date: Wed, 18 May 2022 04:45:19 +0800 Subject: [PATCH] Fix: should flush interface cache by switch network --- listener/tun/ipstack/commons/router.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/listener/tun/ipstack/commons/router.go b/listener/tun/ipstack/commons/router.go index d378cef7..d4ac5743 100644 --- a/listener/tun/ipstack/commons/router.go +++ b/listener/tun/ipstack/commons/router.go @@ -7,6 +7,7 @@ import ( "time" "github.com/Dreamacro/clash/component/dialer" + "github.com/Dreamacro/clash/component/iface" "github.com/Dreamacro/clash/log" ) @@ -61,6 +62,8 @@ func StartDefaultInterfaceChangeMonitor() { dialer.DefaultInterface.Store(interfaceName) + iface.FlushCache() + log.Warnln("[TUN] default interface changed by monitor, %s => %s", old, interfaceName) case <-monitorStop: break