summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2015-01-28 00:31:07 +0000
committerdlg <dlg@openbsd.org>2015-01-28 00:31:07 +0000
commit039b264cfedc4996e68aa3d2d167cee85f12cb8d (patch)
treea61537f5a94dd42fa46b098534a72ed04e6d176d
parenttedu x86_self_ipi()/i386_self_ipi() (diff)
downloadwireguard-openbsd-039b264cfedc4996e68aa3d2d167cee85f12cb8d.tar.xz
wireguard-openbsd-039b264cfedc4996e68aa3d2d167cee85f12cb8d.zip
when doing a blocking read with a timeout, after the sleep reset
the start time so the next read behaves the same. from Simon Mages
-rw-r--r--sys/net/bpf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 361a283e2e5..76396338968 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.114 2015/01/09 04:59:54 tedu Exp $ */
+/* $OpenBSD: bpf.c,v 1.115 2015/01/28 00:31:07 dlg Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
@@ -437,6 +437,7 @@ bpfread(dev_t dev, struct uio *uio, int ioflag)
if (elapsed < d->bd_rtout) {
error = tsleep(d, PRINET|PCATCH, "bpf",
d->bd_rtout - elapsed);
+ d->bd_rdStart = 0;
} else
error = EWOULDBLOCK;
}