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:
parent
ab66fa1484
commit
07c274ac97
1 changed files with 11 additions and 4 deletions
11
sim_ether.c
11
sim_ether.c
|
@ -2478,11 +2478,18 @@ const char *eth_version (void)
|
||||||
static char version[256];
|
static char version[256];
|
||||||
|
|
||||||
if (!version[0]) {
|
if (!version[0]) {
|
||||||
if (memcmp(pcap_lib_version(), "Npcap", 5))
|
|
||||||
strlcpy(version, pcap_lib_version(), sizeof(version));
|
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());
|
snprintf(version, sizeof(version), "Unsupported - %s", pcap_lib_version());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return version;
|
return version;
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue