cmd/ctrld: ensure runDNSServer returns when error happens

This commit is contained in:
Cuong Manh Le
2023-04-28 01:23:06 +07:00
committed by Cuong Manh Le
parent 43fecdf60f
commit a7ea20b117

View File

@@ -434,6 +434,7 @@ func runDNSServer(addr, network string, handler dns.Handler) (*dns.Server, <-cha
go func() {
defer close(errCh)
if err := s.ListenAndServe(); err != nil {
waitLock.Unlock()
mainLog.Error().Err(err).Msgf("could not listen and serve on: %s", s.Addr)
errCh <- err
}