AF_PACKET defrag should not be used for inline modes. Its possible that
a packet received could be larger than can be set when defrag is
enabled, so warn if disabled for inline use.
Likewise, warn if defrag is disabled for IDS use, or non-inline mode.
Ticket: #7458
(cherry picked from commit
808502d5cac0681e17859ed1aef9be8f508c4b13)
aconf->flags |= AFP_SOCK_PROTECT;
aconf->flags |= AFP_NEED_PEER;
}
+
+ /* Warn if inline and defrag is enabled. */
+ if (aconf->copy_mode != AFP_COPY_MODE_NONE && aconf->cluster_type & PACKET_FANOUT_FLAG_DEFRAG) {
+ SCLogWarning(
+ "%s: AF_PACKET defrag is not recommended for inline use, please disable", iface);
+ }
+
+ /* Warn if not inline and defrag is disabled. */
+ if (aconf->copy_mode == AFP_COPY_MODE_NONE && cluster_type == PACKET_FANOUT_HASH &&
+ ((aconf->cluster_type & PACKET_FANOUT_FLAG_DEFRAG) == 0)) {
+ SCLogWarning("%s: AF_PACKET defrag is recommended for IDS cluster_flow", iface);
+ }
+
return aconf;
}