summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2015-09-10 14:11:53 +0000
committerkrw <krw@openbsd.org>2015-09-10 14:11:53 +0000
commit8f5ecb4550f2b08d9f18428e9ca4a26be6f4ecae (patch)
tree777f9c6f10186c9a7c859c35ee20d53ce1b33631
parentif_put after if_get in if_input_process (diff)
downloadwireguard-openbsd-8f5ecb4550f2b08d9f18428e9ca4a26be6f4ecae.tar.xz
wireguard-openbsd-8f5ecb4550f2b08d9f18428e9ca4a26be6f4ecae.zip
Don't stop spoofing GPT partitions when the OpenBSD partition is
found. Keep going until we spoof 8 or run out of partitions needing spoofing.
-rw-r--r--sys/kern/subr_disk.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index ea7b2ad5202..bca3caf3faf 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.201 2015/09/09 19:43:26 krw Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.202 2015/09/10 14:11:53 krw Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -765,9 +765,8 @@ readgptlabel(struct buf *bp, void (*strat)(struct buf *),
break;
}
- /* find OpenBSD partition */
- for (gp_tmp = gp, i = 0; i < letoh32(gh.gh_part_num) && ourpart == -1;
- gp_tmp++, i++) {
+ /* Find OpenBSD partition and spoof others along the way. */
+ for (gp_tmp = gp, i = 0; i < letoh32(gh.gh_part_num); gp_tmp++, i++) {
if (letoh64(gp_tmp->gp_lba_start) > letoh64(gp_tmp->gp_lba_end)
|| letoh64(gp_tmp->gp_lba_start) < letoh64(gh.gh_lba_start)
|| letoh64(gp_tmp->gp_lba_end) > letoh64(gh.gh_lba_end))