Sfoglia il codice sorgente

[SMBIOS] Interpret UUIDs as being in network-endian order

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.
tags/v0.9.4
Michael Brown 16 anni fa
parent
commit
30cd348689
2 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 3
    3
      src/core/uuid.c
  2. 3
    3
      src/include/gpxe/uuid.h

+ 3
- 3
src/core/uuid.c Vedi File

@@ -37,9 +37,9 @@ char * uuid_ntoa ( union uuid *uuid ) {
37 37
 	static char buf[37]; /* "00000000-0000-0000-0000-000000000000" */
38 38
 
39 39
 	sprintf ( buf, "%08lx-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x",
40
-		  le32_to_cpu ( uuid->canonical.a ),
41
-		  le16_to_cpu ( uuid->canonical.b ),
42
-		  le16_to_cpu ( uuid->canonical.c ),
40
+		  be32_to_cpu ( uuid->canonical.a ),
41
+		  be16_to_cpu ( uuid->canonical.b ),
42
+		  be16_to_cpu ( uuid->canonical.c ),
43 43
 		  be16_to_cpu ( uuid->canonical.d ),
44 44
 		  uuid->canonical.e[0], uuid->canonical.e[1],
45 45
 		  uuid->canonical.e[2], uuid->canonical.e[3],

+ 3
- 3
src/include/gpxe/uuid.h Vedi File

@@ -12,11 +12,11 @@
12 12
 union uuid {
13 13
 	/** Canonical form (00000000-0000-0000-0000-000000000000) */
14 14
 	struct {
15
-		/** 8 hex digits, little-endian */
15
+		/** 8 hex digits, big-endian */
16 16
 		uint32_t a;
17
-		/** 2 hex digits, little-endian */
17
+		/** 2 hex digits, big-endian */
18 18
 		uint16_t b;
19
-		/** 2 hex digits, little-endian */
19
+		/** 2 hex digits, big-endian */
20 20
 		uint16_t c;
21 21
 		/** 2 hex digits, big-endian */
22 22
 		uint16_t d;

Loading…
Annulla
Salva