summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2010-01-12 21:42:59 +0000
committerratchov <ratchov@openbsd.org>2010-01-12 21:42:59 +0000
commit8a8522e2d3bc3c990451d1fe4a0ec1ac3853debf (patch)
treefab789eaead1f8ffabab2edf4bab892fde7f68c1
parentWhen attaching a new stream, if the "extra" latency is zero, then (diff)
downloadwireguard-openbsd-8a8522e2d3bc3c990451d1fe4a0ec1ac3853debf.tar.xz
wireguard-openbsd-8a8522e2d3bc3c990451d1fe4a0ec1ac3853debf.zip
check for bogus clock ticks sent by the device; helps tracking
bugs in device drivers.
-rw-r--r--usr.bin/aucat/aproc.c12
-rw-r--r--usr.bin/aucat/safile.c11
2 files changed, 11 insertions, 12 deletions
diff --git a/usr.bin/aucat/aproc.c b/usr.bin/aucat/aproc.c
index 8b1e7f09979..9a34c00817b 100644
--- a/usr.bin/aucat/aproc.c
+++ b/usr.bin/aucat/aproc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aproc.c,v 1.43 2010/01/11 13:06:32 ratchov Exp $ */
+/* $OpenBSD: aproc.c,v 1.44 2010/01/12 21:42:59 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -904,16 +904,6 @@ mix_prime(struct aproc *p)
struct abuf *obuf = LIST_FIRST(&p->obuflist);
unsigned todo, count;
-#ifdef DEBUG
- if (debug_level >= 3) {
- aproc_dbg(p);
- dbg_puts(": prime1: lat/maxlat=");
- dbg_puti(p->u.mix.lat);
- dbg_puts("/");
- dbg_puti(p->u.mix.maxlat);
- dbg_puts("\n");
- }
-#endif
for (;;) {
if (!ABUF_WOK(obuf))
break;
diff --git a/usr.bin/aucat/safile.c b/usr.bin/aucat/safile.c
index 2cbc7e47a54..52106d137a1 100644
--- a/usr.bin/aucat/safile.c
+++ b/usr.bin/aucat/safile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: safile.c,v 1.21 2010/01/11 13:06:32 ratchov Exp $ */
+/* $OpenBSD: safile.c,v 1.22 2010/01/12 21:42:59 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -68,6 +68,15 @@ safile_cb(void *addr, int delta)
struct safile *f = (struct safile *)addr;
struct aproc *p;
+#ifdef DEBUG
+ if (delta < 0 || delta > (60 * RATE_MAX)) {
+ dbg_puts(f->file.name);
+ dbg_puts(": ");
+ dbg_puti(delta);
+ dbg_puts(": bogus sndio delta");
+ dbg_panic();
+ }
+#endif
if (delta != 0) {
p = f->file.wproc;
if (p && p->ops->opos)