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:
1 parent
657133db50
commit
90fb201a51
1 file changed
+1
-1
+1
-1
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user