diff options
author | 2016-12-24 08:41:13 +0000 | |
---|---|---|
committer | 2016-12-24 08:41:13 +0000 | |
commit | a14e054325bca709433b5f7638dfc0f8f9ff747d (patch) | |
tree | a240bdbaa1e646faa394c38f8968f038af5b44e6 | |
parent | minor fixes; (diff) | |
download | wireguard-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.c | 5 |
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; |