3518 Incorrect hostid calculation
authorGarrett D'Amore <garrett@dey-sys.com>
Fri, 01 Feb 2013 12:04:34 -0800
changeset 14249 6b7f159a0cf1
parent 14248 89c6cfbfee9f
child 14250 7ac6fb740bcf
3518 Incorrect hostid calculation Reviewed by: Gordon Ross <[email protected]> Reviewed by: Richard Elling <[email protected]> Reviewed by: Andy Giles <[email protected]> Reviewed by: Dan McDonald <[email protected]> Approved by: Dan McDonald <[email protected]>
usr/src/uts/i86pc/os/startup.c
--- 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