Ignore Npcap pcap_sendpacket return value
A non-zero return value of `pcap_sendpacket` does not neccessarily indicate a failure, as outlined by the Npcap developers in [this issue](https://github.com/nmap/npcap/issues/638).
This commit is contained in:
parent
51ae2ca6f5
commit
9eec3db15b
1 changed files with 2 additions and 4 deletions
|
@ -776,12 +776,10 @@ ssize_t ethsock_recv(struct ethsock *sock, void *buf, size_t len)
|
|||
int ethsock_send(struct ethsock *sock, void *buf, size_t len)
|
||||
{
|
||||
#ifdef NMRPFLASH_WINDOWS
|
||||
if (pcap_sendpacket(sock->pcap, buf, len) == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
if (pcap_sendpacket(sock->pcap, buf, len) != 0 && verbosity > 1) {
|
||||
pcap_perror(sock->pcap, "pcap_sendpacket");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
if (pcap_inject(sock->pcap, buf, len) == len) {
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue