From: Arran Cudbard-Bell Date: Mon, 11 Jun 2018 13:08:53 +0000 (-0400) Subject: Only set HAVE_LIBPCAP if we have both the libraries and header files Fixes #2245 X-Git-Tag: release_3_0_18~294 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1694580e587f5d8efbfbb32c9d63e81b346efde9;p=thirdparty%2Ffreeradius-server.git Only set HAVE_LIBPCAP if we have both the libraries and header files Fixes #2245 --- diff --git a/configure b/configure index 0c59a3c8a9d..32970d7f796 100755 --- a/configure +++ b/configure @@ -2425,6 +2425,8 @@ ac_config_headers="$ac_config_headers src/include/autoconf.h" + + RADIUSD_MAJOR_VERSION=`cat VERSION | cut -f1 -d.` RADIUSD_MINOR_VERSION=`cat VERSION | cut -f2 -d.` @@ -6888,10 +6890,6 @@ if test "x$ac_cv_lib_pcap_pcap_open_live" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcap library not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-lib-dir=." >&5 $as_echo "$as_me: WARNING: pcap library not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-lib-dir=." >&2;} else - -$as_echo "#define HAVE_LIBPCAP 1" >>confdefs.h - - for ac_func in \ pcap_fopen_offline \ pcap_dump_fopen \ @@ -9168,9 +9166,9 @@ fi smart_prefix= - if test "x$ac_cv_header_pcap_h" = "xyes"; then + if test "x$ac_cv_header_pcap_h" = "xyes" && test "x$ac_cv_lib_pcap_pcap_open_live" = "xyes"; then -$as_echo "#define HAVE_PCAP_H 1" >>confdefs.h +$as_echo "#define HAVE_LIBPCAP 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index 43fdbbc3f82..92267654797 100644 --- a/configure.ac +++ b/configure.ac @@ -883,10 +883,6 @@ FR_SMART_CHECK_LIB(pcap, pcap_open_live) if test "x$ac_cv_lib_pcap_pcap_open_live" != "xyes"; then AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-lib-dir=.]) else - AC_DEFINE(HAVE_LIBPCAP, 1, - [Define to 1 if you have the `pcap' library (-lpcap).] - ) - AC_CHECK_FUNCS(\ pcap_fopen_offline \ pcap_dump_fopen \ @@ -1248,8 +1244,8 @@ else dnl # smart_try_dir="$pcap_include_dir" FR_SMART_CHECK_INCLUDE([pcap.h]) - if test "x$ac_cv_header_pcap_h" = "xyes"; then - AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the header file.]) + if test "x$ac_cv_header_pcap_h" = "xyes" && test "x$ac_cv_lib_pcap_pcap_open_live" = "xyes"; then + AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the `pcap' library (-lpcap) and header file .]) AC_SUBST(PCAP_LIBS) AC_SUBST(PCAP_LDFLAGS) else diff --git a/src/include/autoconf.h.in b/src/include/autoconf.h.in index 122bf332a2c..bef4f0caee9 100644 --- a/src/include/autoconf.h.in +++ b/src/include/autoconf.h.in @@ -60,9 +60,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_CAPABILITY_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_IF_PACKET_H - /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME @@ -221,7 +218,8 @@ /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL -/* Define to 1 if you have the `pcap' library (-lpcap). */ +/* Define to 1 if you have the `pcap' library (-lpcap) and header file + . */ #undef HAVE_LIBPCAP /* Define if you have a readline compatible library */ @@ -242,6 +240,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IF_PACKET_H + /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R @@ -320,9 +321,6 @@ /* Define to 1 if you have the `pcap_fopen_offline' function. */ #undef HAVE_PCAP_FOPEN_OFFLINE -/* Define to 1 if you have the header file. */ -#undef HAVE_PCAP_H - /* define this if we have libpcre */ #undef HAVE_PCRE