summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2016-12-07 21:08:55 +0000
committermikeb <mikeb@openbsd.org>2016-12-07 21:08:55 +0000
commit7b86f92e726164a8aa3800e0c350811d6ab0e06e (patch)
treeda077fa2cacc7576b5002a9dd1886893254c1e6b /sys
parentResponse status field is signed; adjust the debug message (diff)
downloadwireguard-openbsd-7b86f92e726164a8aa3800e0c350811d6ab0e06e.tar.xz
wireguard-openbsd-7b86f92e726164a8aa3800e0c350811d6ab0e06e.zip
Add required padding to the response descriptor
Xen source code relies on the compiler to pad members of the structure representing the descriptor layout in memory; we're however trying to be more defensive and define packed structures. Figured out the hard way with reyk@.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pv/xbf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pv/xbf.c b/sys/dev/pv/xbf.c
index b3d9e5c83a0..6a8c22c0b7b 100644
--- a/sys/dev/pv/xbf.c
+++ b/sys/dev/pv/xbf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xbf.c,v 1.4 2016/12/07 21:06:55 mikeb Exp $ */
+/* $OpenBSD: xbf.c,v 1.5 2016/12/07 21:08:55 mikeb Exp $ */
/*
* Copyright (c) 2016 Mike Belopuhov
@@ -98,7 +98,11 @@ struct xbf_ireq {
struct xbf_rsp {
uint64_t rsp_id;
uint8_t rsp_op;
+ uint8_t rsp_pad1;
int16_t rsp_status;
+#ifdef __amd64__
+ uint32_t rsp_pad2;
+#endif
} __packed;
union xbf_ring_desc {