From bd21b5ed9c1fa6b440a57a82c2b29fefacde716d Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 25 Apr 2013 18:34:42 +0200 Subject: [PATCH] Pcap: fix snaplen autodetection, GetIfaceMTU doesn't include link layer length --- src/source-pcap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/source-pcap.c b/src/source-pcap.c index 60e3625cbe..7a31f580aa 100644 --- a/src/source-pcap.c +++ b/src/source-pcap.c @@ -415,7 +415,7 @@ TmEcode ReceivePcapThreadInit(ThreadVars *tv, void *initdata, void **data) { if (pcapconfig->snaplen == 0) { /* We set snaplen if we can get the MTU */ - ptv->pcap_snaplen = GetIfaceMTU(pcapconfig->iface); + ptv->pcap_snaplen = GetIfaceMaxPayloadSize(pcapconfig->iface); } else { ptv->pcap_snaplen = pcapconfig->snaplen; } @@ -562,7 +562,7 @@ TmEcode ReceivePcapThreadInit(ThreadVars *tv, void *initdata, void **data) { if (pcapconfig->snaplen == 0) { /* We try to set snaplen from MTU value */ - ptv->pcap_snaplen = GetIfaceMTU(pcapconfig->iface); + ptv->pcap_snaplen = GetIfaceMaxPayloadSize(pcapconfig->iface); /* be conservative with old pcap lib to mimic old tcpdump behavior when MTU was not available. */ if (ptv->pcap_snaplen <= 0)