]> git.ipfire.org Git - thirdparty/suricata.git/commit
af-packet: delay setting default-packet-size for af-packet
authorJason Ish <jason.ish@oisf.net>
Mon, 17 Mar 2025 16:35:57 +0000 (10:35 -0600)
committerVictor Julien <vjulien@oisf.net>
Tue, 18 Mar 2025 10:02:32 +0000 (11:02 +0100)
commitb8b6ed550a6f10150f5ecf154e7b60c6dc2f84fe
tree7ef5a3f8dd0b57dcee74817e1dc1f13b67f103ef
parent8c7ac89791db16893673e7e5dc1001f802b9a641
af-packet: delay setting default-packet-size for af-packet

AF_PACKET needs more information about its configuration before we can
set the default packet size, so on startup, leave unset in suricata.c
if in AF_PACKET mode.

If defrag is enabled, use a default packet size of 9k for tpacket-v2.
This can still lead to truncation events, then the user can increase
their 'default-packet-size'.

Tpacket-v3 does not need an increased packet size as it will handle
any size of packet that is smaller than the configured block size
which now has a default of 128k.

9k for the snap is somewhat arbitrary but is large enough for the
common 9000 jumbo frame plus some extra headers including tpacket
headers.

Ticket: #7458
src/source-af-packet.c
src/source-af-packet.h
src/suricata.c