diff options
author | 2015-09-10 14:11:53 +0000 | |
---|---|---|
committer | 2015-09-10 14:11:53 +0000 | |
commit | 8f5ecb4550f2b08d9f18428e9ca4a26be6f4ecae (patch) | |
tree | 777f9c6f10186c9a7c859c35ee20d53ce1b33631 | |
parent | if_put after if_get in if_input_process (diff) | |
download | wireguard-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.c | 7 |
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)) |