Blob Blame History Raw
From 219c91bc23fbe762142736b3621bf10853a83b67 Mon Sep 17 00:00:00 2001
Message-Id: <219c91bc23fbe762142736b3621bf10853a83b67@dist-git>
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
Date: Thu, 20 Mar 2014 00:06:18 -0600
Subject: [PATCH] nwfilter: Display pcap's error message when pcap setup fails

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

Display the pcap error message in the log.

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

(cherry picked from commit 64df4c75189b42799f82a8d8816c7c55598d2b6e)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/nwfilter/nwfilter_dhcpsnoop.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index 0b0eb47..e7dd4fa 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -1116,8 +1116,9 @@ virNWFilterSnoopDHCPOpen(const char *ifname, virMacAddr *mac,
     if (pcap_set_snaplen(handle, PCAP_PBUFSIZE) < 0 ||
         pcap_set_buffer_size(handle, PCAP_BUFFERSIZE) < 0 ||
         pcap_activate(handle) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("setup of pcap handle failed"));
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("setup of pcap handle failed: %s"),
+                       pcap_geterr(handle));
         goto cleanup;
     }
 
-- 
1.9.1