Copy the DNS entry going into the cache, to avoid races.

The shuffleAnswers() call ends up acting on the same data,
so it seems simplest to resolve ownership arguments by copying.
This commit is contained in:
Bryan Boreham committed 2015-06-17 11:35:01 +01:00
1 parent 657133db50
commit 90fb201a51
1 file changed
+1 -1
+1 -1
View File
@@ -155,7 +155,7 @@ func (e *cacheEntry) setReply(reply *dns.Msg, ttl int, flags uint8, now time.Tim
e.putTime = now
if reply != nil {
e.reply = *reply
e.reply = *reply.Copy()
e.ReplyLen = reply.Len()
}