mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-03 16:13:30 +08:00
safe dns buff size
This commit is contained in:
parent
14a0a3c790
commit
d0663277dc
@ -110,7 +110,10 @@ func (h *ListenerHandler) NewPacketConnection(ctx context.Context, conn network.
|
|||||||
conn2 = nil
|
conn2 = nil
|
||||||
}()
|
}()
|
||||||
for {
|
for {
|
||||||
buff := buf.NewPacket()
|
// safe size which is 1232 from https://dnsflagday.net/2020/.
|
||||||
|
// so 2048 is enough
|
||||||
|
buff := buf.NewSize(2 * 1024)
|
||||||
|
_ = conn.SetReadDeadline(time.Now().Add(DefaultDnsReadTimeout))
|
||||||
dest, err := conn.ReadPacket(buff)
|
dest, err := conn.ReadPacket(buff)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
buff.Release()
|
buff.Release()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user