]> 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:34:43 +0000 (11:34 +0100)
commitc3be2b29b54bc90daa786d64aee44a8d57493a11
tree705ef0b3e4c9113a651fd9facf328646634fa2b4
parentcbd5bfbbc14d8bf123d16680520e06849dd37cad
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
(cherry picked from commit b8b6ed550a6f10150f5ecf154e7b60c6dc2f84fe)
src/source-af-packet.c
src/source-af-packet.h
src/suricata.c