mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-27 10:47:35 +00:00
router_linux.go: tailscale down restores /etc/resolv.conf file
Signed-off-by: Christina Wen <christina@tailscale.com>
This commit is contained in:
parent
a877dd575c
commit
ee673d5967
@ -163,11 +163,18 @@ func (r *linuxRouter) Close() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set implements the Router interface.
|
// Set implements the Router interface.
|
||||||
func (r *linuxRouter) Set(cfg *Config) error {
|
func (r *linuxRouter) Set(cfg *Config) (err error) {
|
||||||
if cfg == nil {
|
if cfg == nil {
|
||||||
cfg = &shutdownConfig
|
cfg = &shutdownConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
if err != nil {
|
||||||
|
// restore /etc/resolv.conf to its original state.
|
||||||
|
r.dns.Set(dns.Config{})
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if err := r.setNetfilterMode(cfg.NetfilterMode); err != nil {
|
if err := r.setNetfilterMode(cfg.NetfilterMode); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user