Explorar el Código

Merge pull request #42931 from thaJeztah/dont_panic_on_resolv

libnetwork: ServeDNS(): don't panic on unsupported query types
Sebastiaan van Stijn hace 3 años
padre
commit
3e152513b2
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      libnetwork/resolver.go

+ 2 - 1
libnetwork/resolver.go

@@ -384,7 +384,8 @@ func (r *resolver) ServeDNS(w dns.ResponseWriter, query *dns.Msg) {
 	case dns.TypeSRV:
 	case dns.TypeSRV:
 		resp, err = r.handleSRVQuery(name, query)
 		resp, err = r.handleSRVQuery(name, query)
 	default:
 	default:
-		panic("error")
+		queryType := dns.TypeToString[query.Question[0].Qtype]
+		logrus.Debugf("[resolver] query type %s is not supported by the embedded DNS and will be forwarded to external DNS", queryType)
 	}
 	}
 
 
 	if err != nil {
 	if err != nil {