Mercurial > illumos > illumos-gate
changeset 14166:6b7f159a0cf1
3518 Incorrect hostid calculation
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
Reviewed by: Richard Elling <richard.elling@dey-sys.com>
Reviewed by: Andy Giles <andy.giles@dey-sys.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Approved by: Dan McDonald <danmcd@nexenta.com>
author | Garrett D'Amore <garrett@dey-sys.com> |
---|---|
date | Fri, 01 Feb 2013 12:04:34 -0800 |
parents | 89c6cfbfee9f |
children | 7ac6fb740bcf |
files | usr/src/uts/i86pc/os/startup.c |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/i86pc/os/startup.c Mon Aug 26 20:42:32 2013 -0800 +++ b/usr/src/uts/i86pc/os/startup.c Fri Feb 01 12:04:34 2013 -0800 @@ -2779,9 +2779,9 @@ * in loadable modules and not available this early in boot. As we * don't need the values to be cryptographically strong, we just * generate 32-bit vaue by xor'ing the various sequences together, - * which ensures that the enire UUID contributes to the hostid. + * which ensures that the entire UUID contributes to the hostid. */ - int32_t id = 0; + uint32_t id = 0; /* first check against the blacklist */ for (int i = 0; i < (sizeof (smbios_uuid_blacklist) / 16); i++) { @@ -2795,7 +2795,8 @@ for (int i = 0; i < 16; i++) id ^= ((uuid[i]) << (8 * (i % sizeof (id)))); - return (id); + /* Make sure return value is positive */ + return (id & 0x7fffffff); } static int32_t