If using tpacket-v2, defrag and a user provided v2-block-size, warn if
the block size is not large enough to hold one fully defragmented
packet.
Ticket: #7458
SCLogWarning("%s: AF_PACKET defrag is recommended for IDS cluster_flow", iface);
}
+ /* For tpacket-v2, warn if defrag is enabled and block-size is
+ * less than max defragmented packet size. */
+ if ((aconf->flags & AFP_TPACKET_V3) == 0 && (aconf->cluster_type & PACKET_FANOUT_FLAG_DEFRAG) &&
+ aconf->v2_block_size > 0 && aconf->v2_block_size < MAX_PACKET_SIZE) {
+ SCLogWarning("%s: AF_PACKET v2-block-size is not large enough for max fragmented IP packet "
+ "size (%u)",
+ iface, MAX_PACKET_SIZE);
+ }
+
return aconf;
}
* to standard frame size */
#define AFP_BLOCK_SIZE_DEFAULT_ORDER 5
+/* Set max packet size to 65561: IP + Ethernet + 3 VLAN tags. */
+#define MAX_PACKET_SIZE 65561
+
typedef struct AFPIfaceConfig_
{
char iface[AFP_IFACE_NAME_LENGTH];