From 7550067fdeece6b9a7338e63fcd8998316a958d1 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Tue, 8 Feb 2022 22:59:43 +0800 Subject: [PATCH] [Fixed] skip maybe invaild ip data packet --- listener/tun/ipstack/gvisor/tun.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/listener/tun/ipstack/gvisor/tun.go b/listener/tun/ipstack/gvisor/tun.go index 7ec0e650..a0b3b1c5 100644 --- a/listener/tun/ipstack/gvisor/tun.go +++ b/listener/tun/ipstack/gvisor/tun.go @@ -200,6 +200,9 @@ func (t *gvisorAdapter) AsLinkEndpoint() (result stack.LinkEndpoint, err error) p = header.IPv4ProtocolNumber case header.IPv6Version: p = header.IPv6ProtocolNumber + default: + log.Warnln("invalid IP version:%d", header.IPVersion(packet)) + continue } if linkEP.IsAttached() { linkEP.InjectInbound(p, stack.NewPacketBuffer(stack.PacketBufferOptions{