router: split off sandboxed path from router_darwin (#624)

Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
This commit is contained in:
Dmytro Shynkevych
2020-07-31 01:10:14 -04:00
committed by GitHub
parent cb970539a6
commit 8c850947db
4 changed files with 22 additions and 86 deletions

View File

@ -159,17 +159,3 @@ func (r *userspaceBSDRouter) Close() error {
// No interface cleanup is necessary during normal shutdown.
return nil
}
func cleanup(logf logger.Logf, interfaceName string) {
if err := downDNS(interfaceName); err != nil {
logf("dns down: %v", err)
}
// If the interface was left behind, ifconfig down will not remove it.
// In fact, this will leave a system in a tainted state where starting tailscaled
// will result in "interface tailscale0 already exists"
// until the defunct interface is ifconfig-destroyed.
ifup := []string{"ifconfig", interfaceName, "destroy"}
if out, err := cmd(ifup...).CombinedOutput(); err != nil {
logf("ifconfig destroy: %v\n%s", err, out)
}
}