-/* $OpenBSD: bootstrap.c,v 1.7 2015/10/15 19:27:30 miod Exp $ */
+/* $OpenBSD: bootstrap.c,v 1.8 2015/10/19 19:07:59 krw Exp $ */
/*
* Copyright (c) 2013 Joel Sing <jsing@openbsd.org>
}
}
- /* Make sure the bootstrap has left space for the disklabel. */
- lp = (struct disklabel *)(boot + (LABELSECTOR * dl.d_secsize) +
+ /*
+ * Make sure the bootstrap has left space for the disklabel.
+ * N.B.: LABELSECTOR *is* a DEV_BSIZE quantity!
+ */
+ lp = (struct disklabel *)(boot + (LABELSECTOR * DEV_BSIZE) +
LABELOFFSET);
for (i = 0, p = (char *)lp; i < (int)sizeof(*lp); i++)
if (p[i] != 0)