From 281b66eb31a8d2b3669cb87f78cd807183d9c42e Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 21 Sep 2016 06:02:04 +0000 Subject: set BIOCIMMEDIATE, makes the test work for lo0, which does more buffering than regular interfaces --- regress/lib/libpthread/pcap/pcap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'regress/lib') diff --git a/regress/lib/libpthread/pcap/pcap.c b/regress/lib/libpthread/pcap/pcap.c index faa8d38384c..1fed64d9f87 100644 --- a/regress/lib/libpthread/pcap/pcap.c +++ b/regress/lib/libpthread/pcap/pcap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcap.c,v 1.5 2003/07/31 21:48:05 deraadt Exp $ */ +/* $OpenBSD: pcap.c,v 1.6 2016/09/21 06:02:03 otto Exp $ */ /* * Placed in the PUBLIC DOMAIN */ @@ -7,6 +7,7 @@ #include #include #include +#include #include "test.h" @@ -30,12 +31,14 @@ pcap_thread(void *arg) { char errbuf[PCAP_ERRBUF_SIZE]; pcap_t *handle; + int on = 1; SET_NAME("pcap_thread"); CHECKr(pthread_mutex_lock(&dummy)); handle = pcap_open_live(LOOPBACK_IF, SNAPLEN, NO_PROMISC, 0, errbuf); if (!handle) PANIC("You may need to run this test as UID 0 (root)"); + ASSERT(ioctl(pcap_fileno(handle), BIOCIMMEDIATE, &on) != -1); CHECKr(pthread_mutex_unlock(&dummy)); CHECKr(pthread_cond_signal(&syncer)); ASSERT(pcap_loop(handle, PKTCNT, packet_ignore, 0) != -1); -- cgit v1.2.3