pre-fill the tx ring with bogus empty packets

This commit is contained in:
JackDoan
2025-12-18 15:18:19 -06:00
parent 726e282d0a
commit 111efc0779
7 changed files with 57 additions and 50 deletions

View File

@@ -455,11 +455,11 @@ func newPacket(data []byte, incoming bool, fp *firewall.Packet) error {
return ErrPacketTooShort
}
version := int((data[0] >> 4) & 0x0f)
switch version {
case ipv4.Version:
//version := int((data[0] >> 4) & 0x0f)
switch data[0] & 0xf0 {
case ipv4.Version << 4:
return parseV4(data, incoming, fp)
case ipv6.Version:
case ipv6.Version << 4:
return parseV6(data, incoming, fp)
}
return ErrUnknownIPVersion