Skip to content

Commit

Permalink
libnetwork: ServeDNS(): don't panic on unsupported query types
Browse files Browse the repository at this point in the history
This was added in b3c883b, but resulted
in a panic if the embedded DNS had to handle an unsupported query-type,
such as ANY.

This patch adds a debug log for this case (to better describe how it's
handled.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Oct 14, 2021
1 parent 4e6dbb3 commit 9a09448
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libnetwork/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ func (r *resolver) ServeDNS(w dns.ResponseWriter, query *dns.Msg) {
case dns.TypeSRV:
resp, err = r.handleSRVQuery(name, query)
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 {
Expand Down

0 comments on commit 9a09448

Please sign in to comment.