summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryasuoka <yasuoka@openbsd.org>2016-12-24 08:41:13 +0000
committeryasuoka <yasuoka@openbsd.org>2016-12-24 08:41:13 +0000
commita14e054325bca709433b5f7638dfc0f8f9ff747d (patch)
treea240bdbaa1e646faa394c38f8968f038af5b44e6
parentminor fixes; (diff)
downloadwireguard-openbsd-a14e054325bca709433b5f7638dfc0f8f9ff747d.tar.xz
wireguard-openbsd-a14e054325bca709433b5f7638dfc0f8f9ff747d.zip
The unit of the parition offset in disklabel is number of sectors in the
sector size, not in 512 byte blocks. tested by gonzalo.
-rw-r--r--sys/arch/amd64/stand/efiboot/efidev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/amd64/stand/efiboot/efidev.c b/sys/arch/amd64/stand/efiboot/efidev.c
index 5cc41112a9a..41a92cdae90 100644
--- a/sys/arch/amd64/stand/efiboot/efidev.c
+++ b/sys/arch/amd64/stand/efiboot/efidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efidev.c,v 1.23 2016/12/23 07:35:01 yasuoka Exp $ */
+/* $OpenBSD: efidev.c,v 1.24 2016/12/24 08:41:13 yasuoka Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -726,7 +726,8 @@ efistrategy(void *devdata, int rw, daddr32_t blk, size_t size, void *buf,
return sr_strategy(dip->sr_vol, rw, blk, size, buf, rsize);
#endif
nsect = (size + DEV_BSIZE - 1) / DEV_BSIZE;
- blk += dip->disklabel.d_partitions[B_PARTITION(dip->bsddev)].p_offset;
+ blk += DL_SECTOBLK(&dip->disklabel,
+ dip->disklabel.d_partitions[B_PARTITION(dip->bsddev)].p_offset);
if (blk < 0)
error = EINVAL;