mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 21:54:13 +08:00
fix
This commit is contained in:
parent
7c62db5dbd
commit
eeaf6191dd
@ -220,7 +220,9 @@ func (r *Router) Exchange(ctx context.Context, message *mDNS.Msg, options adapte
|
||||
if !cached {
|
||||
var metadata *adapter.InboundContext
|
||||
ctx, metadata = adapter.ExtendContext(ctx)
|
||||
metadata.Destination = M.Socksaddr{}
|
||||
metadata.Destination = M.Socksaddr{
|
||||
Port: metadata.Destination.Port,
|
||||
}
|
||||
metadata.QueryType = message.Question[0].Qtype
|
||||
switch metadata.QueryType {
|
||||
case mDNS.TypeA:
|
||||
|
@ -22,7 +22,9 @@ import (
|
||||
)
|
||||
|
||||
func (r *Router) hijackDNSStream(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
|
||||
metadata.Destination = M.Socksaddr{}
|
||||
metadata.Destination = M.Socksaddr{
|
||||
Port: metadata.Destination.Port,
|
||||
}
|
||||
for {
|
||||
conn.SetReadDeadline(time.Now().Add(C.DNSTimeout))
|
||||
err := dnsOutbound.HandleStreamDNSRequest(ctx, r.dns, conn, metadata)
|
||||
@ -34,7 +36,9 @@ func (r *Router) hijackDNSStream(ctx context.Context, conn net.Conn, metadata ad
|
||||
|
||||
func (r *Router) hijackDNSPacket(ctx context.Context, conn N.PacketConn, packetBuffers []*N.PacketBuffer, metadata adapter.InboundContext) {
|
||||
if natConn, isNatConn := conn.(udpnat.Conn); isNatConn {
|
||||
metadata.Destination = M.Socksaddr{}
|
||||
metadata.Destination = M.Socksaddr{
|
||||
Port: metadata.Destination.Port,
|
||||
}
|
||||
for _, packet := range packetBuffers {
|
||||
buffer := packet.Buffer
|
||||
destination := packet.Destination
|
||||
|
Loading…
x
Reference in New Issue
Block a user