mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
exchangeUDPWithMark used dns.DefaultMsgSize (512 bytes) as the UDP receive buffer. The query sets EDNS0 UDP size 4096, so the upstream may respond with up to 4096 bytes. With a 512-byte buffer, UDP datagram data beyond 512 bytes is silently discarded (UDP datagram property), causing truncated/corrupted DNS responses. Fix: use dns.MaxMsgSize (65535) as the receive buffer, matching the maximum possible UDP datagram size. This ensures large DNS responses (common with DNSSEC or many A/AAAA records) are fully received.