diff --git a/platform/posix/pcap.cpp b/platform/posix/pcap.cpp index a43058c..451fe77 100644 --- a/platform/posix/pcap.cpp +++ b/platform/posix/pcap.cpp @@ -140,6 +140,8 @@ void PCAP::Find(std::vector& found) { struct pcap_pkthdr* header; const uint8_t* data; auto res = pcap_next_ex(iface.fp, &header, &data); + if(res == 0) + continue; if(res < 0 || !header || !data) { if (!warned) { warned = true; @@ -148,8 +150,6 @@ void PCAP::Find(std::vector& found) { } break; } - if(res == 0) - continue; // Keep waiting for that packet EthernetPacketizer ethPacketizer([](APIEvent::Type, APIEvent::Severity) {}); memcpy(ethPacketizer.hostMAC, iface.macAddress, sizeof(ethPacketizer.hostMAC));