Shutting down correct now

Former-commit-id: 692800b411
This commit is contained in:
Owen
2025-11-25 21:21:35 -05:00
parent a32e91de24
commit a38d1ef8a8
4 changed files with 53 additions and 22 deletions

View File

@@ -124,14 +124,17 @@ func (p *DNSProxy) Stop() {
p.middleDevice.RemoveRule(p.proxyIP)
}
p.cancel()
// Close the endpoint first to unblock any pending Read() calls in runPacketSender
if p.ep != nil {
p.ep.Close()
}
p.wg.Wait()
if p.stack != nil {
p.stack.Close()
}
if p.ep != nil {
p.ep.Close()
}
logger.Info("DNS proxy stopped")
}