ETHER: Restore support fir Windows Npcap as Ethernet packet API

Version of Npcap 0.9990 restores full WinPcap functionality

As discussed in nmap/nmap#1929 and nmap/nmap#1343
This commit is contained in:
Mark Pizzolato 2020-04-06 10:36:31 -07:00
parent ab66fa1484
commit 07c274ac97

View file

@ -2478,11 +2478,18 @@ const char *eth_version (void)
static char version[256];
if (!version[0]) {
if (memcmp(pcap_lib_version(), "Npcap", 5))
strlcpy(version, pcap_lib_version(), sizeof(version));
else
if (memcmp(pcap_lib_version(), "Npcap", 5) == 0) {
char maj_min[CBUFSIZE];
char *c = version;
while (*c && !isdigit (*c))
++c;
get_glyph (c, maj_min, ',');
if (strcmp ("0.9990", maj_min) < 0)
snprintf(version, sizeof(version), "Unsupported - %s", pcap_lib_version());
}
}
return version;
#else
return NULL;