1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 07:27:59 -08:00

Fix that atactl sd0 readattr didn't work for some disks. Change it to

check the cksums of the attribute values instead of comparing the
revisions.  diff from NetBSD through naito.yuichiro at gmail.com. test
by kolipe.c at exoticsilicon.com.

ok kevlo miod deraadt
This commit is contained in:
yasuoka 2023-04-30 00:58:38 +00:00
parent 89f0212b2c
commit 5095123fcd

View File

@ -1,4 +1,4 @@
/* $OpenBSD: atactl.c,v 1.48 2023/03/06 17:39:54 miod Exp $ */
/* $OpenBSD: atactl.c,v 1.49 2023/04/30 00:58:38 yasuoka Exp $ */
/* $NetBSD: atactl.c,v 1.4 1999/02/24 18:49:14 jwise Exp $ */
/*-
@ -1657,13 +1657,11 @@ device_attr(int argc, char *argv[])
req.datalen = sizeof(attr_thr);
ata_command(&req);
if (attr_val.revision != attr_thr.revision) {
/*
* Non standard vendor implementation.
* Return, since we don't know how to use this.
*/
return;
}
if (smart_cksum((u_int8_t *)&attr_val, sizeof(attr_val)) != 0)
errx(1, "Checksum mismatch (attr_val)");
if (smart_cksum((u_int8_t *)&attr_thr, sizeof(attr_thr)) != 0)
errx(1, "Checksum mismatch (attr_thr)");
attr = attr_val.attribute;
thr = attr_thr.threshold;