diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-10-29 23:12:47 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-10-29 23:12:47 +0000 |
commit | 3f08a827b963f42b9120de1e028aacbe9bf39e52 (patch) | |
tree | bb7e292d0bf9c464d71a5e479bb5c93522a5673e /sys/arch | |
parent | dc81dfb4888d8507991d39668fdbaabdb97aa708 (diff) |
Limit checksumming correctly at MAXBSIZE.
Don't involve floppies or bad block disks ever in uniqueness tests
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/stand/libsa/diskprobe.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/i386/stand/libsa/diskprobe.c b/sys/arch/i386/stand/libsa/diskprobe.c index 093cf7d99d0..efa39d9aeb1 100644 --- a/sys/arch/i386/stand/libsa/diskprobe.c +++ b/sys/arch/i386/stand/libsa/diskprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskprobe.c,v 1.10 1997/10/28 23:32:08 deraadt Exp $ */ +/* $OpenBSD: diskprobe.c,v 1.11 1997/10/29 23:12:46 niklas Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -129,9 +129,9 @@ diskprobe() /* End of list */ pdi->bios_number = -1; /* Checksumming of hard disks */ - for (i = 0; disksum(i) && i < MAX_CKSUMLEN; i++) + for (i = 0; disksum(i++) && i < MAX_CKSUMLEN; ) ; - bios_cksumlen = i + 1; + bios_cksumlen = i; addbootarg(BOOTARG_CKSUMLEN, sizeof(u_int32_t), &bios_cksumlen); addbootarg(BOOTARG_DISKINFO, (pdi - bios_diskinfo + 1) * sizeof(bios_diskinfo[0]), bios_diskinfo); @@ -190,7 +190,9 @@ disksum(blk) bdi->checksum = adler32(bdi->checksum, buf, DEV_BSIZE); for (bd = bios_diskinfo; bd != bdi; bd++) - if (bdi->checksum == bd->checksum) + if ((bd->bios_number & 0x80) && + !(bd->flags & BDI_INVALID) && + bdi->checksum == bd->checksum) reprobe = 1; } |