ETHER: Report Windows Npcap as unsupported in the Ethernet version string

Current versions of Npcap can talk directly to the host system's network
stack.  This defect was just discovered.  Fortunately, WinPcap 4.1.3 works
as needed and is still functional on Windows 10.

As discussed in nmap/nmap#1929 and nmap/nmap#1343
This commit is contained in:
Mark Pizzolato 2020-02-19 01:39:13 -08:00
parent 46500ec75e
commit 721e2f42c5

View file

@ -1077,7 +1077,7 @@ static const char* lib_name =
static char no_pcap[PCAP_ERRBUF_SIZE] =
#if defined(_WIN32) || defined(__CYGWIN__)
"wpcap.dll failed to load, install Npcap or WinPcap 4.x to use pcap networking";
"wpcap.dll failed to load, install Npcap or WinPcap 4.1.3 to use pcap networking";
#elif defined(__APPLE__)
"/usr/lib/libpcap.A.dylib failed to load, install libpcap to use pcap networking";
#else
@ -2474,7 +2474,15 @@ return SCPE_OK;
const char *eth_version (void)
{
#if defined(HAVE_PCAP_NETWORK)
return pcap_lib_version();
static char version[256];
if (!version[0]) {
if (memcmp(pcap_lib_version(), "Npcap", 5))
strlcpy(version, pcap_lib_version(), sizeof(version));
else
snprintf(version, sizeof(version), "Unsupported - %s", pcap_lib_version());
}
return version;
#else
return NULL;
#endif