1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 10:08:15 -05:00

Always use a DNS Message ID of 0 for DoH and DoQ

This commit is contained in:
dyhkwong 2024-05-20 00:09:43 +08:00 committed by Xiaokang Wang (Shelikhoo)
parent 8191faa6e0
commit 54c2c6d537
2 changed files with 2 additions and 6 deletions

View File

@ -11,7 +11,6 @@ import (
"net/http"
"net/url"
"sync"
"sync/atomic"
"time"
"golang.org/x/net/dns/dnsmessage"
@ -35,7 +34,6 @@ type DoHNameServer struct {
ips map[string]record
pub *pubsub.Service
cleanup *task.Periodic
reqID uint32
httpClient *http.Client
dohURL string
name string
@ -204,7 +202,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) {

View File

@ -6,7 +6,6 @@ import (
"encoding/binary"
"net/url"
"sync"
"sync/atomic"
"time"
"github.com/quic-go/quic-go"
@ -35,7 +34,6 @@ type QUICNameServer struct {
ips map[string]record
pub *pubsub.Service
cleanup *task.Periodic
reqID uint32
name string
destination net.Destination
connection quic.Connection
@ -149,7 +147,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) {