From 5fea70dbfa292536761c95ee7021a61ef925b73e Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Fri, 9 Aug 2013 14:53:24 +0200 Subject: [PATCH] check if libpcap has PCAP_ERROR_IFACE_NOT_UP This should prevent DNS plugin from being built on systems with libpcap older than 1.0.0. GitHub issue #373 --- configure.in | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/configure.in b/configure.in index a62d608b..6b437203 100644 --- a/configure.in +++ b/configure.in @@ -3013,6 +3013,25 @@ then AC_CHECK_HEADERS(pcap-bpf.h,, [with_libpcap="no (pcap-bpf.h not found)"]) fi +if test "x$with_libpcap" = "xyes" +then + AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP], + [c_cv_libpcap_have_pcap_error_iface_not_up], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[[ +#include +]]], +[[[ + int val = PCAP_ERROR_IFACE_NOT_UP; +]]] + )], + [c_cv_libpcap_have_pcap_error_iface_not_up="yes"], + [c_cv_libpcap_have_pcap_error_iface_not_up="no"])) +fi +if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes" +then + with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)" +fi AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes") # }}} -- 2.11.0