int snaplen = default_packet_size;
if (snaplen == 0) {
- snaplen = GetIfaceMaxPacketSize(ptv->livedev);
- if (snaplen <= 0) {
- SCLogWarning("%s: unable to get MTU, setting snaplen default of 1514", ptv->iface);
- snaplen = 1514;
+ if (ptv->cluster_type & PACKET_FANOUT_FLAG_DEFRAG) {
+ SCLogConfig("%s: defrag enabled, setting snaplen to %d", ptv->iface,
+ DEFAULT_TPACKET_DEFRAG_SNAPLEN);
+ snaplen = DEFAULT_TPACKET_DEFRAG_SNAPLEN;
+ } else {
+ snaplen = GetIfaceMaxPacketSize(ptv->livedev);
+ if (snaplen <= 0) {
+ SCLogWarning("%s: unable to get MTU, setting snaplen default of 1514", ptv->iface);
+ snaplen = 1514;
+ }
}
}
int snaplen = default_packet_size;
if (snaplen == 0) {
- snaplen = GetIfaceMaxPacketSize(ptv->livedev);
- if (snaplen <= 0) {
- SCLogWarning("%s: unable to get MTU, setting snaplen default of 1514", ptv->iface);
- snaplen = 1514;
+ if (ptv->cluster_type & PACKET_FANOUT_FLAG_DEFRAG) {
+ SCLogConfig("%s: defrag enabled, setting snaplen to %d", ptv->iface,
+ DEFAULT_TPACKET_DEFRAG_SNAPLEN);
+ snaplen = DEFAULT_TPACKET_DEFRAG_SNAPLEN;
+ } else {
+ snaplen = GetIfaceMaxPacketSize(ptv->livedev);
+ if (snaplen <= 0) {
+ SCLogWarning("%s: unable to get MTU, setting snaplen default of 1514", ptv->iface);
+ snaplen = 1514;
+ }
}
}
/* Set max packet size to 65561: IP + Ethernet + 3 VLAN tags. */
#define MAX_PACKET_SIZE 65561
+/* Default snaplen to use when defrag enabled. 9k is somewhat
+ * arbitrary but is large enough for the common 9000 jumbo frame plus
+ * some extra headers including tpacket headers. */
+#define DEFAULT_TPACKET_DEFRAG_SNAPLEN 9216
+
typedef struct AFPIfaceConfig_
{
char iface[AFP_IFACE_NAME_LENGTH];
int nlive;
int strip_trailing_plus = 0;
switch (suri->run_mode) {
+ case RUNMODE_AFP_DEV:
+ /* For AF_PACKET we delay setting the
+ * default-packet-size until we know more about the
+ * configuration. */
+ break;
#ifdef WINDIVERT
case RUNMODE_WINDIVERT: {
/* by default, WinDivert collects from all devices */
/* fall through */
case RUNMODE_PLUGIN:
case RUNMODE_PCAP_DEV:
- case RUNMODE_AFP_DEV:
case RUNMODE_AFXDP_DEV:
nlive = LiveGetDeviceCount();
for (lthread = 0; lthread < nlive; lthread++) {