[SMBIOS] Interpret UUIDs as being in network-endian order
authorMichael Brown <mcb30@etherboot.org>
Tue, 20 May 2008 17:41:36 +0000 (18:41 +0100)
committerMichael Brown <mcb30@etherboot.org>
Tue, 20 May 2008 17:41:36 +0000 (18:41 +0100)
Various specification documents disagree about the byte ordering of
UUIDs.  However, SMBIOS seems to use the standard in which everything is
in network-endian order.

This doesn't affect anything sent on the wire; only what gets printed on
the screen when the "uuid" variable is displayed.

src/core/uuid.c
src/include/gpxe/uuid.h

index dae26c1..c6e7f5d 100644 (file)
@@ -37,9 +37,9 @@ char * uuid_ntoa ( union uuid *uuid ) {
        static char buf[37]; /* "00000000-0000-0000-0000-000000000000" */
 
        sprintf ( buf, "%08lx-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x",
-                 le32_to_cpu ( uuid->canonical.a ),
-                 le16_to_cpu ( uuid->canonical.b ),
-                 le16_to_cpu ( uuid->canonical.c ),
+                 be32_to_cpu ( uuid->canonical.a ),
+                 be16_to_cpu ( uuid->canonical.b ),
+                 be16_to_cpu ( uuid->canonical.c ),
                  be16_to_cpu ( uuid->canonical.d ),
                  uuid->canonical.e[0], uuid->canonical.e[1],
                  uuid->canonical.e[2], uuid->canonical.e[3],
index 4f89be5..18d1f14 100644 (file)
 union uuid {
        /** Canonical form (00000000-0000-0000-0000-000000000000) */
        struct {
-               /** 8 hex digits, little-endian */
+               /** 8 hex digits, big-endian */
                uint32_t a;
-               /** 2 hex digits, little-endian */
+               /** 2 hex digits, big-endian */
                uint16_t b;
-               /** 2 hex digits, little-endian */
+               /** 2 hex digits, big-endian */
                uint16_t c;
                /** 2 hex digits, big-endian */
                uint16_t d;