Commit Graph

196 Commits

Author SHA1 Message Date
dmiller 248fe810c7 Get runtime version of libdnet if possible 2026-09-25 16:04:15 +00:00
dmiller a2f996605c Update libdnet to 1.18.2 2026-09-24 18:30:14 +00:00
dmiller f06312d885 Silence a few MS CRT warnings 2026-09-22 19:28:38 +00:00
dmiller 9369f7a9df Fix mismatch between switch condition and case size
On macOS (and probably other BSDs), the sa_family member is 8 bits, so
comparing with 0xffff and other 16-bit values overflows. Cast to a wider
type to resolve the issue.
2026-09-19 02:26:42 +00:00
nnposter 2758101bf5 Rudimentary NSE support for 802.1Q / 802.1ad VLAN tags 2026-09-11 03:01:08 +00:00
dmiller c1086f1e15 Silence some compiler warnings from the NetBSD build 2026-08-20 17:40:54 +00:00
dmiller 4233de2df1 Avoid semicolon after do{}while(0) macro definition 2026-07-15 23:35:13 +00:00
dmiller 33c39cd389 Fix check for PF_PACKET, fails with clang 2026-04-02 19:14:10 +00:00
dmiller deb076224e Reintegrate Nmap 7.99 release branch 2026-03-27 13:52:02 +00:00
dmiller 8cf08ee9cb Handle EAFNOSUPPORT as on FreeBSD 2026-03-19 17:39:59 +00:00
dmiller ce2e99cb29 Use headers to determine BSD-style BPF support. Fixes #3289 2026-03-16 17:21:51 +00:00
dmiller 7f2764927b Fail if libdnet doesn't include eth or route support. See #3289 2026-03-10 18:32:49 +00:00
dmiller 1b3ca45054 Compatibility fixes and Github autobuilds. Closes #3214 2026-01-12 16:59:25 +00:00
dmiller 58874849d3 Reintegrate Nmap 7.98 release branch 2025-08-21 20:24:37 +00:00
dmiller 7c4e1bf58d Permit ENOENT for /dev/bpf as on macOS. Fixes #3127 2025-06-05 22:22:27 +00:00
dmiller 1c24021222 DOn't define strlcat. Our subset of libdnet doesn't use it 2025-04-29 17:36:26 +00:00
dmiller 6da8066ef8 Enable IPv6 in Windows libdnet build 2025-04-21 20:37:16 +00:00
dmiller 21e5cc67b4 Windows build fixes for libdnet-stripped 2025-04-11 16:39:12 +00:00
dmiller 210d6c0847 Upgrade libdnet to 1.18.0, plus Nmap's changes
Nmap's changes have been moved from the NMAP_MODIFICATIONS file to the
Github repo at https://github.com/nmap/libdnet

The NMAP_MODIFICATIONS file instead will document only the changes made
to strip unused parts of the libdnet source prior to inclusion in Nmap.
2025-03-31 19:30:47 +00:00
dmiller bc3f8ee141 Fix compile errors on Windows 2023-02-10 22:51:52 +00:00
dmiller ba707b1ac6 Enable IPv6 neighbor cache lookups for Windows 2023-02-08 23:21:27 +00:00
dmiller 79cd3db24c Fix arp cache lookup for Windows: avoid MIB_IPNET_TYPE_INVALID 2023-02-08 22:01:36 +00:00
dmiller caf1e5d299 Don't label non-Eth-like interfaces as Ethernet. See #2381 2023-01-30 21:45:55 +00:00
dmiller 2708a5b399 Avoid realloc leak 2022-08-29 17:11:27 +00:00
dmiller 10c4479b2d Fix #2416: listing interfaces on IPv6-only Linux. 2022-07-05 16:20:17 +00:00
nnposter db39ee0518 Add missing includes to route.h test for FreeBSD. Fixes #2379 2022-04-20 17:09:55 +00:00
dmiller 2181443b63 Address a few code analysis warnings: uninitialized vars and undefined behavior 2021-08-06 16:17:46 +00:00
dmiller 1820469f5a Bump supported Windows to Win7 (drop Vista) and update a deprecated API 2021-07-29 21:09:44 +00:00
dmiller 9b36c5b2b8 libdnet: Remove call to FreeLibrary after GetModuleHandle.
Per Windows API docs: "do not pass a handle returned by GetModuleHandle
to the FreeLibrary function. Doing so can cause a DLL module to be
unmapped prematurely."
2021-07-23 16:50:12 +00:00
dmiller 95d98fe6ae Linker optimizations for all projects (Windows) 2021-07-22 17:19:53 +00:00
dmiller 5707fb14c5 Upgrade to VS 2019 2021-07-19 23:58:02 +00:00
nnposter 004c8627c1 Do not override snprintf in VS 2015 and newer
MSVC preprocessor triggers #error in <stdio.h> if redefined

From MS doc:
Beginning with the UCRT in Visual Studio 2015 and Windows 10, snprintf is
no longer identical to _snprintf. The snprintf function behavior is now C99
standard compliant.

Closes #2255
2021-04-16 02:33:39 +00:00
dmiller a5cca6f6a3 Remove replacement strlcat (unused) from libdnet-stripped 2020-10-13 20:13:38 +00:00
dmiller e61f145425 Make strlcpy signature match declaration in libdnet-stripped. See #2150 2020-10-13 20:13:37 +00:00
dmiller cbe650092c Fix loopback detection on Windows with new Npcap 2020-09-03 20:14:00 +00:00
dmiller 8d59507aad Support Npcap 0.9983's new loopback behavior 2019-09-03 19:13:14 +00:00
dmiller d8c1d935f1 Move Npcap headers and lib stuff to nmap-mswin32-aux 2018-10-18 03:28:39 +00:00
dmiller 30db709755 Optimistically revert mutex that was needed with WinPcap. Npcap likely is unaffected. 2018-10-03 16:57:54 +00:00
dmiller 626f10aca0 libdnet: Keep result of pcap_findalldevs around to avoid re-calling frequently 2018-09-18 04:21:18 +00:00
dmiller d8bcee17bd Get LoopbackAdapter name from service reg key instead of software reg key 2018-08-21 18:21:06 +00:00
dmiller 36a6d897a5 Use correct width in sscanf. Fixes #1156 2018-03-22 16:31:32 +00:00
dmiller 571cd2d903 Move non-config definitions to the file where they are used. Closes #1013 2017-09-19 17:01:38 +00:00
dmiller 4c3450ce05 Fix route detection on FreeBSD. 2017-08-02 18:48:27 +00:00
dmiller 2f104650a8 Detect SNMP MIB2 STREAMS on Solaris even if /dev/ip is not present. 2017-02-13 19:46:23 +00:00
yang c238ef3df4 Fix MSVC 2010's compilation warning on DLT_NULL_HEADER pointer assignment (https://github.com/nmap/nmap/issues/563) 2016-10-06 03:40:29 +00:00
dmiller d5f7d5c45b Permit sending on DLT_NULL devices on Windows 2016-08-14 12:29:50 +00:00
dmiller af13cef717 Upgrade to Npcap 0.08 (libpcap 1.8.0 headers for Windows) 2016-08-13 20:04:05 +00:00
dmiller b8fb5be8a1 Sanity check on IPv6 addresses: they must be 128 bits or less 2016-07-30 03:54:01 +00:00
dmiller 85dd7e6ac1 Fix a potential buffer overrun due to sscanf using the wrong field width 2016-07-27 20:11:27 +00:00
vincent 900f015726 Silencing sizeof() warning
Here, the sizeof() function return the size of 'char *' instead of 
INTF_NAME_LEN. I replaced the use of the latter function by INTF_NAME_LEN 
(maximum size of the array intf_name). Here is the compiler warning output:

route-bsd.c:171:38: warning: sizeof on array function parameter will return 
size of 'char *' instead of 'char [16]' [-Wsizeof-array-argument] 
strlcpy(intf_name, namebuf, sizeof(intf_name));
2016-07-01 11:27:37 +00:00