Copy queries prior to packing them in resolvers (#290)

* Copy queries prior to packing them in resolvers

* Fix race in quic restart logic

* Remove bad lock
This commit is contained in:
Frank Olbricht
2023-04-01 09:16:55 +02:00
committed by GitHub
parent bf6dff4b63
commit 017544e9f4
4 changed files with 12 additions and 0 deletions

View File

@@ -65,6 +65,9 @@ func NewDNSClient(id, endpoint, network string, opt DNSClientOptions) (*DNSClien
// Resolve a DNS query.
func (d *DNSClient) Resolve(q *dns.Msg, ci ClientInfo) (*dns.Msg, error) {
// Packing a message is not always a read-only operation, make a copy
q = q.Copy()
logger(d.id, q, ci).WithFields(logrus.Fields{
"resolver": d.endpoint,
"protocol": d.net,