6 Commits
Author SHA1 Message Date
TWO666 9574a46c32 fix: truncate udp dns replies to the client's advertised buffer size (#3043) 2026-07-29 08:54:18 +08:00
TWO666 fb002210ff fix: tun dns hijack sending zero-filled or stale packets when PackBuffer reallocates (#3037)
D.Msg.PackBuffer sizes its scratch space by the uncompressed message length
and silently allocates a new slice when that exceeds the given buffer, even
though the compressed result would fit. The udp hijack path in
listener/sing_tun/dns.go always sends the original buffer, producing a
correct-length datagram full of zeros or stale bytes whenever a reply's
uncompressed size exceeds SafeDnsPacketSize (e.g. 100+ A records for one
name). Copy the packed result back into the caller's buffer when it fits.
The tcp path in RelayDnsConn already guards against this; the udp path did
not.
2026-07-27 13:03:03 +08:00
wwqgtxx 939e4109d7 chore: write dns reply in single syscall 2025-06-07 00:38:39 +08:00
wwqgtxx bd703b8ff2 fix: truncate dns message in udp response
https://github.com/MetaCubeX/mihomo/issues/1168
2024-04-09 14:16:09 +08:00
wwqgtxx fad1a08378 chore: dns outbound support tcp 2024-03-07 13:12:40 +08:00
wwqgtxx 8b9813079b chore: share RelayDnsPacket function code 2024-03-04 22:12:27 +08:00