tsnet,wgenegine/netstack: add test and fix resource leaks

We were not closing the http.Server and were also not waiting for
netstack to fully close.

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2023-03-27 11:37:50 -07:00
committed by Maisem Ali
parent 2a933c1903
commit 920ec69241
3 changed files with 14 additions and 1 deletions

View File

@@ -222,6 +222,7 @@ func Create(logf logger.Logf, tundev *tstun.Wrapper, e wgengine.Engine, mc *magi
func (ns *Impl) Close() error {
ns.ctxCancel()
ns.ipstack.Close()
ns.ipstack.Wait()
return nil
}