From 9f0600c96d69ec16d69c5eadd57569c1a3b9bb98 Mon Sep 17 00:00:00 2001 From: Kaian Date: Mon, 24 Oct 2016 11:23:33 +0200 Subject: [PATCH] capture: Increase capture snaplen for live captures #150 --- src/capture.c | 2 +- src/capture.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/capture.c b/src/capture.c index 502352c..b7c0592 100644 --- a/src/capture.c +++ b/src/capture.c @@ -128,7 +128,7 @@ capture_online(const char *dev, const char *outfile) } // Open capture device - capinfo->handle = pcap_open_live(dev, BUFSIZ, 1, 1000, errbuf); + capinfo->handle = pcap_open_live(dev, MAXIMUM_SNAPLEN, 1, 1000, errbuf); if (capinfo->handle == NULL) { fprintf(stderr, "Couldn't open device %s: %s\n", dev, errbuf); return 2; diff --git a/src/capture.h b/src/capture.h index fb30051..8cf5f45 100644 --- a/src/capture.h +++ b/src/capture.h @@ -74,6 +74,8 @@ //! Max allowed packet assembled size #define MAX_CAPTURE_LEN 20480 +//! Max allowed packet length +#define MAXIMUM_SNAPLEN 262144 //! Define VLAN 802.1Q Ethernet type #ifndef ETHERTYPE_8021Q