mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +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
|
||||
}()
|
||||
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)
|
||||
if err != nil {
|
||||
buff.Release()
|
||||
|
|
Loading…
Reference in New Issue
Block a user