@ -538,7 +538,9 @@ func (m *Manager) FlushCaches() error {
// CleanUp restores the system DNS configuration to its original state
// CleanUp restores the system DNS configuration to its original state
// in case the Tailscale daemon terminated without closing the router.
// in case the Tailscale daemon terminated without closing the router.
// No other state needs to be instantiated before this runs.
// No other state needs to be instantiated before this runs.
func CleanUp ( logf logger . Logf , netMon * netmon . Monitor , interfaceName string ) {
//
// health must not be nil
func CleanUp ( logf logger . Logf , netMon * netmon . Monitor , health * health . Tracker , interfaceName string ) {
oscfg , err := NewOSConfigurator ( logf , nil , nil , interfaceName )
oscfg , err := NewOSConfigurator ( logf , nil , nil , interfaceName )
if err != nil {
if err != nil {
logf ( "creating dns cleanup: %v" , err )
logf ( "creating dns cleanup: %v" , err )
@ -546,7 +548,7 @@ func CleanUp(logf logger.Logf, netMon *netmon.Monitor, interfaceName string) {
}
}
d := & tsdial . Dialer { Logf : logf }
d := & tsdial . Dialer { Logf : logf }
d . SetNetMon ( netMon )
d . SetNetMon ( netMon )
dns := NewManager ( logf , oscfg , nil , d , nil , nil , runtime . GOOS )
dns := NewManager ( logf , oscfg , health , d , nil , nil , runtime . GOOS )
if err := dns . Down ( ) ; err != nil {
if err := dns . Down ( ) ; err != nil {
logf ( "dns down: %v" , err )
logf ( "dns down: %v" , err )
}
}