chore: better tun config passing

This commit is contained in:
wwqgtxx
2022-11-03 18:56:03 +08:00
parent 1b0d09068b
commit 9a5c0a4b6d
3 changed files with 22 additions and 20 deletions

View File

@ -259,7 +259,10 @@ func loadProxyProvider(proxyProviders map[string]provider.ProxyProvider) {
}
func updateTun(tun *config.Tun) {
P.ReCreateTun(tun, tunnel.TCPIn(), tunnel.UDPIn())
if tun == nil {
return
}
P.ReCreateTun(*tun, tunnel.TCPIn(), tunnel.UDPIn())
P.ReCreateRedirToTun(tun.RedirectToTun)
}