[Fixed] skip maybe invaild ip data packet

This commit is contained in:
Skyxim 2022-02-08 22:59:43 +08:00
parent 076a0840bf
commit 7550067fde

View file

@ -200,6 +200,9 @@ func (t *gvisorAdapter) AsLinkEndpoint() (result stack.LinkEndpoint, err error)
p = header.IPv4ProtocolNumber p = header.IPv4ProtocolNumber
case header.IPv6Version: case header.IPv6Version:
p = header.IPv6ProtocolNumber p = header.IPv6ProtocolNumber
default:
log.Warnln("invalid IP version:%d", header.IPVersion(packet))
continue
} }
if linkEP.IsAttached() { if linkEP.IsAttached() {
linkEP.InjectInbound(p, stack.NewPacketBuffer(stack.PacketBufferOptions{ linkEP.InjectInbound(p, stack.NewPacketBuffer(stack.PacketBufferOptions{