From 83fd814a2c4cd2a2645e299d1fc7f2258511abd4 Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 30 Jan 2014 03:40:26 +0000 Subject: [PATCH] Really fix nsock's pcap configuration This wasn't using Nmap's included libpcap if no options were specified, instead compiling nsock without pcap support if no libpcap could be found (which breaks Nmap) --- nsock/src/configure | 11 +++++++---- nsock/src/configure.ac | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/nsock/src/configure b/nsock/src/configure index 0ca555ef7..a86df8b38 100755 --- a/nsock/src/configure +++ b/nsock/src/configure @@ -3539,10 +3539,7 @@ fi ;; included) - LIBPCAP_INC=${top_nmap_srcdir}/libpcap - LIBPCAP_LIB=${top_nmap_srcdir}/libpcap - LIBPCAP_LIBS=${LIBPCAP_LIB}/libpcap.a - have_libpcap=yes + have_libpcap=no ;; no) ;; @@ -3611,6 +3608,12 @@ fi fi +if test "$with_libpcap" != "no" -a "$have_libpcap" = "no"; then + LIBPCAP_INC=${top_nmap_srcdir}/libpcap + LIBPCAP_LIB=${top_nmap_srcdir}/libpcap + LIBPCAP_LIBS=${LIBPCAP_LIB}/libpcap.a + have_libpcap=yes +fi if test "$have_libpcap" != "no"; then $as_echo "#define HAVE_PCAP 1" >>confdefs.h diff --git a/nsock/src/configure.ac b/nsock/src/configure.ac index f6bf5b696..75f8ee5e3 100644 --- a/nsock/src/configure.ac +++ b/nsock/src/configure.ac @@ -128,10 +128,7 @@ AC_HELP_STRING([--without-libpcap], [Disable pcap functions.]), have_libpcap=yes ]) ;; included) - LIBPCAP_INC=${top_nmap_srcdir}/libpcap - LIBPCAP_LIB=${top_nmap_srcdir}/libpcap - LIBPCAP_LIBS=${LIBPCAP_LIB}/libpcap.a - have_libpcap=yes + have_libpcap=no ;; no) ;; @@ -155,6 +152,12 @@ AC_HELP_STRING([--without-libpcap], [Disable pcap functions.]), esac] ) +if test "$with_libpcap" != "no" -a "$have_libpcap" = "no"; then + LIBPCAP_INC=${top_nmap_srcdir}/libpcap + LIBPCAP_LIB=${top_nmap_srcdir}/libpcap + LIBPCAP_LIBS=${LIBPCAP_LIB}/libpcap.a + have_libpcap=yes +fi if test "$have_libpcap" != "no"; then AC_DEFINE(HAVE_PCAP) if test "${LIBPCAP_INC+set}" = "set"; then