From 971790a972d514927dc558e3c97aac94fb897923 Mon Sep 17 00:00:00 2001 From: fyodor Date: Thu, 17 Aug 2006 00:36:00 +0000 Subject: [PATCH] Final pcap changes --- CHANGELOG | 12 +++++++----- configure | 23 +++++++---------------- configure.ac | 22 ++++++---------------- 3 files changed, 20 insertions(+), 37 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 813fe7f1a..04c274b49 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,13 +5,15 @@ o Worked with Zhao to improve the new OS detection system with better algorithms and bug fixes. o Nmap now uses the (relatively) new libpcap pcap_get_selectable_fd - API on systems which support it. This means that we no longer need to - hack the included Pcap to better support Linux. So Nmap will now link - with an existing system libpcap by default on that platform if one is - detected. + API on systems which support it. This means that we no longer need + to hack the included Pcap to better support Linux. So Nmap will now + link with an existing system libpcap by default on that platform if + one is detected. Thanks to Doug Hoyte for the patch. o Updated the included libpcap from 0.9.3 to 0.9.4. The changes I - made are in libpcap/NMAP_MODIFICATIONS . + made are in libpcap/NMAP_MODIFICATIONS . By default, Nmap will now + use the included libpcap unless version 0.9.4 or greater is already + installed on the system. o Applied some nsock bugfixes from Diman Todorov. These don't affect the current version of Nmap, but are important for his upcoming diff --git a/configure b/configure index b3db0ba35..c5a207b83 100755 --- a/configure +++ b/configure @@ -5878,25 +5878,16 @@ cat >>conftest.$ac_ext <<_ACEOF #include extern char pcap_version[]; int main() { - int major, minor; - sscanf(pcap_version,"%d.%d", &major, &minor); + int major, minor1, minor2; + sscanf(pcap_version,"%d.%d.%d", &major, &minor1, &minor2); + printf("The pcap version is %s -> %d.%d.%d\n", pcap_version, major, minor1, minor2); if (major > 0) exit(0); - if (minor > 4) - exit(0); - if (minor < 4) + if (minor1 < 9) exit(1); - if (pcap_version[3] > 'a') - exit(0); - if (pcap_version[3] == 'a') { - if(!sscanf(&pcap_version[4], "%d", &minor)) - exit(1); - if (minor >= 6) - exit(0); - else - exit(1); - } - exit(1); + if (minor2 < 4) + exit(1); + exit(0); } _ACEOF rm -f conftest$ac_exeext diff --git a/configure.ac b/configure.ac index 9f6a99a46..bfd68e432 100644 --- a/configure.ac +++ b/configure.ac @@ -381,25 +381,15 @@ if test $have_libpcap = yes; then #include extern char pcap_version[]; int main() { - int major, minor; - sscanf(pcap_version,"%d.%d", &major, &minor); + int major, minor1, minor2; + sscanf(pcap_version,"%d.%d.%d", &major, &minor1, &minor2); if (major > 0) exit(0); - if (minor > 4) - exit(0); - if (minor < 4) + if (minor1 < 9) exit(1); - if (pcap_version[3] > 'a') - exit(0); - if (pcap_version[3] == 'a') { - if(!sscanf(&pcap_version[4], "%d", &minor)) - exit(1); - if (minor >= 6) - exit(0); - else - exit(1); - } - exit(1); + if (minor2 < 4) + exit(1); + exit(0); }], [AC_MSG_RESULT(yes); have_libpcap=yes], [AC_MSG_RESULT(no); have_libpcap=no],