diff options
author | 2016-12-07 21:08:55 +0000 | |
---|---|---|
committer | 2016-12-07 21:08:55 +0000 | |
commit | 7b86f92e726164a8aa3800e0c350811d6ab0e06e (patch) | |
tree | da077fa2cacc7576b5002a9dd1886893254c1e6b | |
parent | Response status field is signed; adjust the debug message (diff) | |
download | wireguard-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@.
-rw-r--r-- | sys/dev/pv/xbf.c | 6 |
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 { |