Show pcap_inject errors with '-vv' on Windows
This commit is contained in:
parent
5ae8412024
commit
25e2364930
1 changed files with 8 additions and 5 deletions
13
ethsock.c
13
ethsock.c
|
@ -780,13 +780,16 @@ int ethsock_send(struct ethsock *sock, void *buf, size_t len)
|
||||||
{
|
{
|
||||||
if (pcap_inject(sock->pcap, buf, len) != len) {
|
if (pcap_inject(sock->pcap, buf, len) != len) {
|
||||||
#ifdef NMRPFLASH_WINDOWS
|
#ifdef NMRPFLASH_WINDOWS
|
||||||
// In recent Npcap versions, pcap_inject fails if the
|
// Npcap's pcap_inject fails in many cases where neither
|
||||||
// interface is unplugged. This doesn't happen on either
|
// Linux or macOS report an error. For now, we simply
|
||||||
// Linux or macOS.
|
// ignore errors if unplugged (and let all other through
|
||||||
|
// as well, just printing a debug line).
|
||||||
|
|
||||||
if (ethsock_is_unplugged(sock)) {
|
if (!ethsock_is_unplugged(sock) && verbosity > 1) {
|
||||||
return 0;
|
pcap_perror(sock->pcap, "pcap_inject");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
pcap_perror(sock->pcap, "pcap_inject");
|
pcap_perror(sock->pcap, "pcap_inject");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue