mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-10 02:53:12 +00:00
Fix dns inbound
This commit is contained in:
parent
e5e24ef51d
commit
e531e89b4b
|
@ -49,7 +49,10 @@ func (d *DNS) NewConnection(ctx context.Context, conn net.Conn, metadata adapter
|
|||
|
||||
func (d *DNS) NewPacket(ctx context.Context, conn N.PacketConn, buffer *buf.Buffer, metadata adapter.InboundContext) error {
|
||||
d.udpNat.NewContextPacket(ctx, metadata.Source.AddrPort(), buffer, adapter.UpstreamMetadata(metadata), func(natConn N.PacketConn) (context.Context, N.PacketWriter) {
|
||||
return adapter.WithContext(log.ContextWithNewID(ctx), &metadata), natConn
|
||||
return adapter.WithContext(log.ContextWithNewID(ctx), &metadata), &udpnat.DirectBackWriter{
|
||||
Source: conn,
|
||||
Nat: natConn,
|
||||
}
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue