Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/dns/dnscache.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ func (c *DNSCache) updateIPEntry(qname string, rrs []dnsgo.RR, lookupTime time.T
c.Lock()
defer c.Unlock()

if c.fqdnToEntry == nil {
c.fqdnToEntry = map[string]cacheEntry{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this gets initialized in the constructor? Why does it happen?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a false trail. The stack trace was complaining about a different map.

}

entry, exists := c.fqdnToEntry[qname]
if !exists {
entry = cacheEntry{}
Expand Down