Blob Blame History Raw
From c0b8cd530233a9b6bfdf6a46525d44c415b399a7 Mon Sep 17 00:00:00 2001
Message-Id: <c0b8cd530233a9b6bfdf6a46525d44c415b399a7@dist-git>
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
Date: Thu, 20 Mar 2014 00:06:17 -0600
Subject: [PATCH] nwfilter: Increase buffer size for libpcap

https://bugzilla.redhat.com/show_bug.cgi?id=1078347

Libpcap 1.5 requires a larger buffer than previous pcap versions.
Adjust the size of the buffer to 128kb.

This patch should address symptoms in BZ 1071181 and BZ 731059

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

(cherry picked from commit 49b59a151f60b0a178b023b727bac30f80bd6000)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/nwfilter/nwfilter_dhcpsnoop.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index 2bc1686..0b0eb47 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -250,7 +250,11 @@ struct _virNWFilterDHCPDecodeJob {
 # define DHCP_PKT_BURST         50 /* pkts/sec */
 # define DHCP_BURST_INTERVAL_S  10 /* sec */
 
-# define PCAP_BUFFERSIZE        (DHCP_PKT_BURST * PCAP_PBUFSIZE / 2)
+/*
+ * libpcap 1.5 requires a 128kb buffer
+ * 128 kb is bigger than (DHCP_PKT_BURST * PCAP_PBUFSIZE / 2)
+ */
+# define PCAP_BUFFERSIZE        (128 * 1024)
 
 # define MAX_QUEUED_JOBS        (DHCP_PKT_BURST + 2 * DHCP_PKT_RATE)
 
-- 
1.9.1