Skip to content

Commit

Permalink
Always use a DNS Message ID of 0 for DoH and DoQ
Browse files Browse the repository at this point in the history
  • Loading branch information
dyhkwong committed May 19, 2024
1 parent 8191faa commit e5c165c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/dns/nameserver_doh.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"net/http"
"net/url"
"sync"
"sync/atomic"
"time"

"golang.org/x/net/dns/dnsmessage"
Expand Down Expand Up @@ -204,7 +203,7 @@ func (s *DoHNameServer) updateIP(req *dnsRequest, ipRec *IPRecord) {
}

func (s *DoHNameServer) newReqID() uint16 {
return uint16(atomic.AddUint32(&s.reqID, 1))
return 0
}

func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, clientIP net.IP, option dns_feature.IPOption) {
Expand Down
3 changes: 1 addition & 2 deletions app/dns/nameserver_quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/binary"
"net/url"
"sync"
"sync/atomic"
"time"

"github.com/quic-go/quic-go"
Expand Down Expand Up @@ -149,7 +148,7 @@ func (s *QUICNameServer) updateIP(req *dnsRequest, ipRec *IPRecord) {
}

func (s *QUICNameServer) newReqID() uint16 {
return uint16(atomic.AddUint32(&s.reqID, 1))
return 0
}

func (s *QUICNameServer) sendQuery(ctx context.Context, domain string, clientIP net.IP, option dns_feature.IPOption) {
Expand Down

0 comments on commit e5c165c

Please sign in to comment.