1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

67 Commits

Author SHA1 Message Date
dmiller
aed27d094e Update libpcap to 1.10.5 2025-04-14 19:06:54 +00:00
dmiller
7ae5c4d927 Rename VERSION to VERSION.txt; macOS build broke 2023-06-28 18:16:55 +00:00
dmiller
585832c41e Upgrade libpcap to 1.10.4 2023-04-28 14:37:51 +00:00
dmiller
19508bffe4 Fix macOS build of libpcap due to case-insensitive filesystem. Rename VERSION to VERSION.txt 2023-02-24 21:10:14 +00:00
dmiller
65410fead1 Update included libpcap to 1.10.1 2022-08-31 18:39:55 +00:00
nnposter
8b5eff97e9 Fix a typo. Closes #2295 2022-02-13 17:28:56 +00:00
dmiller
1a510d0940 Document Nmap modifications to libpcap 1.9.1. 2019-11-19 17:53:41 +00:00
dmiller
7789fc8446 Apply patch 1 to avoid rebuilding scanner and grammar files 2019-11-19 17:53:40 +00:00
dmiller
2d256eda3d Generate libpcap files, remove extra content, apply patch 2 2019-11-19 17:53:39 +00:00
dmiller
f1107301e8 Update to libpcap 1.9.1 (initial commit, no Nmap-specific patches) 2019-11-19 17:53:36 +00:00
dmiller
9ea82c000c Avoid trying to find flex/bison when configuring libpcap (we pre-generate those files) 2019-11-11 14:41:35 +00:00
dmiller
6fb1ed73a6 Track bpf_filter.c, previously a generated file. Fixes #1545 2019-04-13 21:42:54 +00:00
dmiller
2a1b900adf Restore a few necessary parts of libpcap. Final commit for libpcap 1.9.0 upgrade 2019-03-30 03:24:50 +00:00
dmiller
bea1ff6d61 Avoid infinite loop on make clean with included libpcap 2019-03-30 03:24:48 +00:00
dmiller
8964da2406 Disable unused features of libpcap 2019-03-30 03:24:47 +00:00
dmiller
58c633f31a Don't autogenerate Lex & Yacc files 2019-03-30 03:24:46 +00:00
dmiller
a2442ea29f Update libpcap to 1.9.0 (no patches applied yet) 2019-03-30 03:24:44 +00:00
dmiller
12f7822950 Add libpcap/grammar.h to avoid build problems. Fixes #1275 2018-07-22 23:08:31 +00:00
dmiller
d95bc032c6 Upgrade libpcap to 1.8.1 2018-07-18 13:41:40 +00:00
dmiller
172ef58889 libpcap: Disable unnecessary features
The following features are disabled:

* monitor-mode sniffing of wireless interfaces on Linux, via libnl
* building shared libraries
* Bluetooth support
* usb support
* dbus capture support
2018-07-18 13:41:38 +00:00
dmiller
87107dd6b1 libpcap: Don't autogenerate Lex/Yacc files 2018-07-18 13:41:38 +00:00
dmiller
3fc4a6fc95 Upgrade libpcap to 1.8.1 (Nmap-specific patches not yet applied) 2018-07-18 13:41:35 +00:00
dmiller
83c2bc1d18 Remove some more generated files when doing a distclean. Fixes #218 2015-10-07 16:34:12 +00:00
dmiller
54bd372ccf CHANGELOG and mod patches for mutex change 2015-09-20 19:06:12 +00:00
dmiller
3d9e348832 Use a mutex on Windows to avoid a hang when accessing WinPCAP driver
Reported by multiple users on Windows 8.1 and Windows Server 2012 R2.
Seems to hang when the WinPCAP driver is accessed via OpenServiceA by
multiple processes at once. Users report that this change, which uses a
mutex to avoid concurrent access, fixes the hang.
2015-09-20 19:06:11 +00:00
dmiller
c86bf7bfa0 Add previous commit to libpcap/NMAP_MODIFICATIONS/ 2015-09-15 13:31:21 +00:00
dmiller
83b9c4c939 Disable TPACKET_V3 in included libpcap. Still broken, see #34 2015-09-15 13:31:21 +00:00
dmiller
4bbef7d69b Update libpcap to 1.7.3, partially addressing #34 2015-05-01 20:24:47 +00:00
dmiller
fce840446d Fix --enable-packet-ring config option for libpcap, was impossible to enable 2015-04-28 13:18:22 +00:00
dmiller
580c2555ea Disable libnl by default when building with included libpcap
Libpcap only needs libnl for monitor-mode sniffing. Disabling it lets us
not worry about which -lnl or -lnl-3 linker argument to include in our
own LIBS, so Nmap builds properly no matter whether libnl is present or
not.
2015-03-03 17:52:12 +00:00
dmiller
635495a018 Modify libpcap configure script to disable unused features
bluetooth, usb, usb-can, and dbus sniffing. Dbus support caused a build
problem on CentOS 6.5. Would have preferred to pass these configurations
from our own configure script, but AC_CONFIG_SUBDIRS does not allow for
it.
2014-06-11 18:19:25 +00:00
jay
d8071c0352 Updated the included libpcap to 1.5.3 2014-06-06 10:43:17 +00:00
david
1eba012356 Rearrange libpcap patch files for AIX compatibility.
The patch that moves "config.h" to the top of scanner.l (and hence
scanner.c) has to happen before the files are pregenerated, otherwise
there is an error on AIX:

In file included from scanner.c:2792:
/usr/include/unistd.h:171: error: conflicting types for 'lseek64'
/usr/include/unistd.h:169: error: previous declaration of 'lseek64' was here
2012-04-13 15:50:15 +00:00
david
ac92a747dc Add a libpcap patch for compilation on Solaris 11. 2012-04-10 02:56:41 +00:00
david
75856fd1dd Make NMAP_MODIFICATIONS into a directory with discrete patch files. 2012-04-10 00:47:51 +00:00
david
5d24d23600 Update libpcap to 1.2.1. 2012-04-10 00:47:45 +00:00
david
7197d18d52 Cherry-pick changes to require <linux/compiler.h>.
I needed this to build with --with-libpcap=included on Linux 2.6.16,
otherwise I got this error:

gcc -g -O2 -O2 -fpic -I.  -DHAVE_CONFIG_H  -D_U_="__attribute__((unused))" -c ./pcap-usb-linux.c
./pcap-usb-linux.c: In function ‘probe_devices’:
./pcap-usb-linux.c:234: error: storage size of ‘ctrl’ isn’t known
./pcap-usb-linux.c:279: error: ‘USBDEVFS_CONTROL’ undeclared (first use in this function)
./pcap-usb-linux.c:279: error: (Each undeclared identifier is reported only once
./pcap-usb-linux.c:279: error: for each function it appears in.)
make[1]: *** [pcap-usb-linux.o] Error 1

commit a092bafeee07c97352d2c6d06780220286ab2db0
Author: Guy Harris <guy@alum.mit.edu>
Date:   Tue Nov 30 15:52:45 2010 -0800

    In test programs, just as in pcap-usb-linux.c, if we have
    <linux/compiler.h> we (probably need to include it before including
    <linux/usbdevice_fs.h>, otherwise the test may fail when it shouldn't.

commit b019cc06cb4fdc01f99a36581fe7b55e2533d663
Author: Guy Harris <guy@alum.mit.edu>
Date:   Thu Nov 25 14:06:01 2010 -0800

    Check whether we have <linux/compiler.h>.

    Not all distributions have it in /usr/include; I guess the ones that
    don't have it have versions of other kernel headers that don't require
    it.

commit 0920898be2ede72baafa2a02e77ea223ecbe4f9a
Author: Guy Harris <guy@alum.mit.edu>
Date:   Thu Nov 25 13:49:16 2010 -0800

    Include <linux/compiler.h> before including <linux/usbdevice_fs.h>.

    Some versions of the Linux kernel require that.

commit 85089fea5732acc004dcc7e6aebcb0510c37f675
Author: Guy Harris <guy@alum.mit.edu>
Date:   Fri Jun 4 10:48:16 2010 -0700

    Do filtering on USB and Bluetooth capturing.

    Do the standard userland filtering on USB and Bluetooth captures, rather
    than returning "success" when the filter is installed without doing
    anything with the filter.

    Also, squelch some "dereferencing type-punned pointer will break
    strict-aliasing rules" warnings in pcap-bt-linux.c, by using memcpy
    rather than pointer-casting.
2011-10-27 15:38:30 +00:00
david
354305f67c Add scanner.l config.h change to NMAP_MODIFICATIONS. 2011-09-21 17:41:22 +00:00
david
b883c1d14f Include config.h at the %top of scanner.c.
On AIX, config.h defines _LARGE_FILES. This interacts badly with other
includes generated at the top of scanner.c, leading to errors like this:

In file included from scanner.c:2784:
/usr/include/unistd.h:171: error: conflicting types for 'lseek64'
/usr/include/unistd.h:169: error: previous declaration of 'lseek64' was here
In file included from /usr/include/unistd.h:746,
                 from scanner.c:2784:
/usr/include/sys/lockf.h:64: error: conflicting types for 'lockf64'
/usr/include/sys/lockf.h:62: error: previous declaration of 'lockf64' was here
2011-09-21 17:41:22 +00:00
david
364e6f64d8 Regenerate scanner.c with flex 2.5.35.
./runlex.sh flex -Ppcap_ -oscanner.c scanner.l
2011-09-21 17:41:21 +00:00
luis
d4ec0386e4 Added a note about the patch in r20315 2010-09-23 06:44:51 +00:00
luis
faaca263b9 When using pcap_set_filter() on Linux, valgrind complains about a
setsockopt() call that uses a pointer to some uninitialized memory. The
error message is the following:

==22214== Syscall param socketcall.setsockopt(optval) points to
uninitialised byte(s)
==22214==    at 0x62F774A: setsockopt (syscall-template.S:82)
==22214==    by 0x4E33B85: ??? (in /usr/lib/libpcap.so.1.0.0)
==22214==    by 0x4E33D0D: ??? (in /usr/lib/libpcap.so.1.0.0)
==22214==    by 0x432253: nsock_pcap_set_filter (in /usr/local/bin/nping)
==22214==    by 0x432557: nsock_pcap_open (in /usr/local/bin/nping)
==22214==    by 0x4295FF: ProbeMode::start() (in /usr/local/bin/nping)
==22214==    by 0x40B2E1: main (in /usr/local/bin/nping)

This patch adds a simple memset() call that makes the warning dissapear.
2010-09-22 09:41:06 +00:00
david
38019ded5c o [libpcap] Added a --disable-packet-ring option to force the use of
an older, slower packet capture mechanism on Linux. Before Linux
  2.6.27, the packet ring mechanism uses different-sized kernel
  structures on 32- and 64-bit architectures, so a 32-bit program will
  not run correctly on a 64-bit kernel. The older mechanism does not
  have this flaw.
2010-05-26 20:43:09 +00:00
david
4ac98563ab Upgrade our included libpcap to 1.1.1. 2010-04-21 04:39:45 +00:00
david
89ea71e792 Add the libpcap merge from r17349 to NMAP_MODIFICATIONS. 2010-04-19 19:39:04 +00:00
david
dedbb7f6ee Merge commit 43acbb77a8e0b3346b574b3e28793de2d6985e69 from libpcap
upstream (git://bpf.tcpdump.org/libpcap). This is a workaround for the
BIOCSRTIMEOUT bug in 10.6, 10.6.1, and 10.6.3 that doesn't work for
non-integer timeouts. A symptom of being affected by the bug is Nmap
haning forever at the first call to pcap_next. 10.6.2 was somehow not
affected.

This alone still doesn't solve the problem; I still have to make the
default --with-libpcap=included for 64-bit OS X.

The source comment is informative:
/*
 * XXX - Mac OS X 10.6 mishandles BIOCSRTIMEOUT in 64-bit userland - it
 * takes, as an argument, a "struct BPF_TIMEVAL", which has 32-bit
 * tv_sec and tv_usec, rather than a "struct timeval".
 *
 * If this platform defines "struct BPF_TIMEVAL", we check whether the
 * structure size in BIOCSRTIMEOUT is that of a "struct timeval" and, if
 * not, we use a "struct BPF_TIMEVAL" rather than a "struct timeval".
 * (That way, if the bug is fixed in a future release, we will still do
 * the right thing.)
 */

commit 43acbb77a8e0b3346b574b3e28793de2d6985e69
Author: Guy Harris <guy@alum.mit.edu>
Date:   Sun Oct 11 11:05:46 2009 -0700

    Work around an annoying Snow Leopard BPF bug that causes sub-second
    timeouts not to work in 64-bit userland code (Snow Leopard's GCC builds
    64-bit by default on 64-bit machines).
2010-04-19 19:22:01 +00:00
fyodor
364ecfca39 Fixed a bug which lead to libpcap ./configure errors on Solaris which
looked like:

./configure: line 6651: syntax error near unexpected token `in'
./configure: line 6651: `       for ac_header in'
configure: error: ./configure failed for libpcap

Example: http://seclists.org/nmap-dev/2010/q1/444

The problem is a bogus empty test in the libpcap/configure.in.  It
was actually fixed by libpcap in SVN back in 2008, but there hasn't
been a release since then :(.  They seem to still be actively developing,
just not making releases.  Sigh.
2010-03-24 05:48:02 +00:00
david
d00a574ae0 Fix a messed-up patch in NMAP_MODIFICATIONS. 2009-11-04 18:50:55 +00:00
david
637774e960 Remove the dummy grammar.c and scanner.c rules after the all rule, so
that they are not the default, remove duplicate dummy fules for them,
and combine the modification with an existing one for Flex/Bison removal
in NMAP_MODIFICATIONS.
2009-11-04 18:49:07 +00:00
fyodor
a759174b84 Added dummy rules to inhibit GNU Make's implicit yacc/lex creation of scanner.c and grammar.c - was causing trouble with the new upgraded libpcap 2009-11-03 21:41:43 +00:00