diff options
author | 2016-05-21 14:22:31 +0000 | |
---|---|---|
committer | 2016-05-21 14:22:31 +0000 | |
commit | 4a16c56320b80e38dc1197bbb048aa1c88a7262c (patch) | |
tree | 64afe151d9ae7df60671602b58395c8752fe35f7 /sys/kern/subr_disk.c | |
parent | Remove another erroneous VOP_CLOSE/vput, which was missed with the last (diff) | |
download | wireguard-openbsd-4a16c56320b80e38dc1197bbb048aa1c88a7262c.tar.xz wireguard-openbsd-4a16c56320b80e38dc1197bbb048aa1c88a7262c.zip |
Fix logic bug in DUID generation - we want to generate DUIDs until we have
one that is not a duplicate and not a zero DUID.
ok krw@
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r-- | sys/kern/subr_disk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 3f740e4cfed..d3076845240 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_disk.c,v 1.226 2016/05/21 14:00:27 jsing Exp $ */ +/* $OpenBSD: subr_disk.c,v 1.227 2016/05/21 14:22:31 jsing Exp $ */ /* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */ /* @@ -917,7 +917,7 @@ setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_int openmask) if (dk->dk_label && duid_equal(dk->dk_label->d_uid, nlp->d_uid)) break; - } while (dk != NULL && duid_iszero(nlp->d_uid)); + } while (dk != NULL || duid_iszero(nlp->d_uid)); } /* Preserve the disk size and RAW_PART values. */ |