According to WinPcap documentation of `pcap_dispatch` (https://www.winpcap.org/docs/docs_41b5/html/group__wpcapfunc.html#g60ce104cd...):
A cnt of -1 processes all the packets received in one buffer when reading a live capture, or all the packets in the file when reading a ``savefile''
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55487 Signed-off-by: Alexis Murzeau amubtdx@gmail.com
I've tried to see if I could add a test calling pcap_dispatch with a negative count, but that would require having real ethernet interface connected to a network and maybe also appropriate Linux privileges to capture real packets.
Instead, I've tested manually both pcap_dispatch and pcap_loop using the test_pcap.c source file I've given in the bug page, and now it works.
From: Alexis Murzeau amubtdx@gmail.com
According to WinPcap documentation of `pcap_dispatch` (https://www.winpcap.org/docs/docs_41b5/html/group__wpcapfunc.html#g60ce104cd...):
A cnt of -1 processes all the packets received in one buffer when reading a live capture, or all the packets in the file when reading a ``savefile''
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55487 Signed-off-by: Alexis Murzeau amubtdx@gmail.com --- dlls/wpcap/wpcap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wpcap/wpcap.c b/dlls/wpcap/wpcap.c index 8c304ce66a4..f96e7098ae5 100644 --- a/dlls/wpcap/wpcap.c +++ b/dlls/wpcap/wpcap.c @@ -967,7 +967,7 @@ int CDECL pcap_dispatch( struct pcap *pcap, int count,
TRACE( "%p, %d, %p, %p\n", pcap, count, callback, user );
- while (processed < count) + while (count <= 0 || processed < count) { struct pcap_pkthdr_win32 *hdr = NULL; const unsigned char *data = NULL; @@ -1000,7 +1000,7 @@ int CDECL pcap_loop( struct pcap *pcap, int count,
TRACE( "%p, %d, %p, %p\n", pcap, count, callback, user );
- while (processed < count) + while (count <= 0 || processed < count) { struct pcap_pkthdr_win32 *hdr = NULL; const unsigned char *data = NULL;