From: guy Date: Sat, 2 Feb 2008 20:57:04 +0000 (+0000) Subject: Treat a max_packets value of 0 the same way that we treat a max_packets X-Git-Tag: libpcap-1.0.0~137 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/1dfbba087de0b9a112e6c759120824fcf77a4fd4 Treat a max_packets value of 0 the same way that we treat a max_packets value of -1. --- diff --git a/pcap-linux.c b/pcap-linux.c index 3d947264..942dca3f 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -34,7 +34,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.129.2.5 2008-01-24 20:21:34 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.129.2.6 2008-02-02 20:57:04 guy Exp $ (LBL)"; #endif /* @@ -1803,9 +1803,9 @@ pcap_read_linux_mmap(pcap_t *handle, int max_packets, pcap_handler callback, } while (ret < 0); } - /* negative values of max_packets are used to require all - * packets available in the ring */ - while ((pkts < max_packets) || (max_packets <0)) { + /* non-positive values of max_packets are used to require all + * packets currently available in the ring */ + while ((pkts < max_packets) || (max_packets <= 0)) { int run_bpf; struct sockaddr_ll *sll; struct pcap_pkthdr pcaphdr;