diff options
author | Peiwei Hu <jlu.hpw@foxmail.com> | 2021-11-02 15:53:34 +0800 |
---|---|---|
committer | Thomas Habets <thomas@habets.se> | 2021-11-02 08:54:56 +0000 |
commit | 239f9f39cae315cbabaddca3fb9921bb528adc28 (patch) | |
tree | 42582d741366772e804449de46190f9141548629 | |
parent | 9647d8ed7b9f9f3c5fb7dd12ddbadf7c7623e6c1 (diff) | |
download | arping-239f9f39cae315cbabaddca3fb9921bb528adc28.tar.gz |
Augment return value check of pcap_next_ex
pcap_next_ex returns >0 on success.
-rw-r--r-- | src/windows.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/windows.c b/src/windows.c index 1b74834..9b2440d 100644 --- a/src/windows.c +++ b/src/windows.c @@ -54,7 +54,7 @@ ping_recv_win32(pcap_t *pcap, uint32_t packetwait, pcap_handler func) while (!done && !time_to_die) { struct pcap_pkthdr *pkt_header; u_char *pkt_data; - if (pcap_next_ex(pcap, &pkt_header, &pkt_data) == 1) { + if (pcap_next_ex(pcap, &pkt_header, &pkt_data) > 0) { func(pcap, pkt_header, pkt_data); } getclock(&tv); |