summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2010-04-16 12:19:07 +0000
committerdlg <dlg@openbsd.org>2010-04-16 12:19:07 +0000
commit652821e38ca0658c7bc0f0e69a7dc31505f0df8f (patch)
tree3df2e3026ac4060f8fa07378453b2b1994b19996
parentMove a function to a place that is a bit more logical. No functional change. (diff)
downloadwireguard-openbsd-652821e38ca0658c7bc0f0e69a7dc31505f0df8f.tar.xz
wireguard-openbsd-652821e38ca0658c7bc0f0e69a7dc31505f0df8f.zip
byteswap the number of blocks on physical disks for bioctl correctly.
makes output sane on sparc64 and other BE archs. found by jason george
-rw-r--r--sys/dev/ic/mpi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 6575612ebc1..e1115661f91 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.141 2010/04/16 01:10:19 deraadt Exp $ */
+/* $OpenBSD: mpi.c,v 1.142 2010/04/16 12:19:07 dlg Exp $ */
/*
* Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org>
@@ -2958,7 +2958,7 @@ mpi_ioctl_disk(struct mpi_softc *sc, struct bioc_disk *bd)
bd->bd_channel = pdpg0.phys_disk_bus;
bd->bd_target = pdpg0.phys_disk_id;
bd->bd_lun = 0;
- bd->bd_size = (u_quad_t)pdpg0.max_lba * 512;
+ bd->bd_size = (u_quad_t)letoh32(pdpg0.max_lba) * 512;
strlcpy(bd->bd_vendor, pdpg0.vendor_id, sizeof(bd->bd_vendor));
switch (pdpg0.phys_disk_state) {