From 3bb57504af8efe8dd1a931cc3792978433b34602 Mon Sep 17 00:00:00 2001 From: Maisem Ali Date: Tue, 9 Aug 2022 13:29:34 -0700 Subject: [PATCH] net/dns/resolver: add comments clarifying nil error returns Signed-off-by: Maisem Ali --- net/dns/resolver/forwarder.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/dns/resolver/forwarder.go b/net/dns/resolver/forwarder.go index 6bf7382d1..f51325e80 100644 --- a/net/dns/resolver/forwarder.go +++ b/net/dns/resolver/forwarder.go @@ -676,6 +676,8 @@ func (f *forwarder) forwardWithDestChan(ctx context.Context, query packet, respo res, err := nxDomainResponse(query) if err != nil { f.logf("error parsing bonjour query: %v", err) + // Returning an error will cause an internal retry, there is + // nothing we can do if parsing failed. Just drop the packet. return nil } select { @@ -700,6 +702,8 @@ func (f *forwarder) forwardWithDestChan(ctx context.Context, query packet, respo res, err := servfailResponse(query) if err != nil { f.logf("building servfail response: %v", err) + // Returning an error will cause an internal retry, there is + // nothing we can do if parsing failed. Just drop the packet. return nil } select {