From 80ee994727041a1f723809a63f617274285edf7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 22 Sep 2022 16:33:25 +0800 Subject: [PATCH] Fix system ipv4 overflow --- internal/clashtcpip/ip.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/clashtcpip/ip.go b/internal/clashtcpip/ip.go index ad65679..598656f 100644 --- a/internal/clashtcpip/ip.go +++ b/internal/clashtcpip/ip.go @@ -173,7 +173,7 @@ func (p IPv4Packet) PseudoSum() uint32 { } func (p IPv4Packet) Valid() bool { - return len(p) >= IPv4HeaderSize && uint16(len(p)) >= p.TotalLen() + return len(p) >= IPv4HeaderSize && p.TotalLen() >= p.HeaderLen() && uint16(len(p)) >= p.TotalLen() } func (p IPv4Packet) Verify() error {