Skip to content

Commit 0f230f7

Browse files
committed
Exchange() now seems to skip Pack() if Data is not empty
1 parent d4242ce commit 0f230f7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

dnscrypt-proxy/plugin_forward.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ func (plugin *PluginForward) Eval(pluginsState *PluginsState, msg *dns.Msg) erro
312312
// Create a clean copy of the message without Extra section for forwarding
313313
forwardMsg := msg.Copy()
314314
forwardMsg.Extra = nil
315+
forwardMsg.Data = nil // Clear packed data so Exchange will re-pack without Extra
315316

316317
respMsg, _, err = client.Exchange(ctx, forwardMsg, pluginsState.serverProto, server)
317318
if err != nil {

dnscrypt-proxy/resolve.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func resolveQuery(server string, qName string, qType uint16, sendClientSubnet bo
5151
readTimeout := transport.ReadTimeout
5252
for i := 0; i < 3; i++ {
5353
msg.ID = dns.ID()
54+
msg.Data = nil // Clear packed data so Exchange will re-pack with new ID
5455
ctx, cancel := context.WithTimeout(context.Background(), readTimeout)
5556
response, rtt, err := client.Exchange(ctx, msg, "udp", server)
5657
cancel()

0 commit comments

Comments
 (0)