summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2015-07-24 08:50:29 +0000
committerratchov <ratchov@openbsd.org>2015-07-24 08:50:29 +0000
commit1664e8c8d82106f76679c80ed8101e62ee38ee19 (patch)
tree2abad51c938bf43a9c593915683ab6d4e622906b
parentCrank watchdog timeout from 2 to 4 seconds. (diff)
downloadwireguard-openbsd-1664e8c8d82106f76679c80ed8101e62ee38ee19.tar.xz
wireguard-openbsd-1664e8c8d82106f76679c80ed8101e62ee38ee19.zip
Fix arithmetic mistake causing errors when there are more xruns on the
record side than on the play side. This almost never happens are record buffer are much larger than play buffers.
-rw-r--r--lib/libsndio/sio_sun.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libsndio/sio_sun.c b/lib/libsndio/sio_sun.c
index 19604f004f9..3b34146bc14 100644
--- a/lib/libsndio/sio_sun.c
+++ b/lib/libsndio/sio_sun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sio_sun.c,v 1.14 2015/02/16 06:04:06 ratchov Exp $ */
+/* $OpenBSD: sio_sun.c,v 1.15 2015/07/24 08:50:29 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -875,7 +875,7 @@ sio_sun_revents(struct sio_hdl *sh, struct pollfd *pfd)
DPRINTFN(2, "will drop %d and pause %d\n", offset, doerr);
} else if (offset < 0) {
hdl->sio.wsil += -offset * hdl->obpf;
- hdl->odelta -= offset;
+ hdl->odelta -= -offset;
DPRINTFN(2, "will insert %d and pause %d\n", -offset, dierr);
}