summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2016-07-29 21:05:26 +0000
committermikeb <mikeb@openbsd.org>2016-07-29 21:05:26 +0000
commit55f4ff3de7886f674d9baf99ebdb78ee57c506be (patch)
tree3a873328000151fcfabae0fb1e74a23da46d88d7
parentadd a check that the arguments to isavail don't overflow. (diff)
downloadwireguard-openbsd-55f4ff3de7886f674d9baf99ebdb78ee57c506be.tar.xz
wireguard-openbsd-55f4ff3de7886f674d9baf99ebdb78ee57c506be.zip
Loop until we've read all available responses
-rw-r--r--sys/dev/pv/xenstore.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pv/xenstore.c b/sys/dev/pv/xenstore.c
index c4647cfe3d2..b3c2ee9ac18 100644
--- a/sys/dev/pv/xenstore.c
+++ b/sys/dev/pv/xenstore.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xenstore.c,v 1.28 2016/04/19 18:15:41 mikeb Exp $ */
+/* $OpenBSD: xenstore.c,v 1.29 2016/07/29 21:05:26 mikeb Exp $ */
/*
* Copyright (c) 2015 Mike Belopuhov
@@ -530,6 +530,7 @@ xs_intr(void *arg)
/* Response processing */
+ again:
if (xs->xs_rmsg == NULL) {
if (avail < sizeof(xmh)) {
printf("%s: incomplete header: %d\n",
@@ -597,6 +598,9 @@ xs_intr(void *arg)
}
}
+ if ((avail = xs_ring_avail(xsr, 0)) > 0)
+ goto again;
+
out:
/* Wakeup sleeping writes (if any) */
wakeup(xs->xs_wchan);