Explorar el Código

[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 hace 16 años
padre
commit
30cd348689
Se han modificado 2 ficheros con 6 adiciones y 6 borrados
  1. 3
    3
      src/core/uuid.c
  2. 3
    3
      src/include/gpxe/uuid.h

+ 3
- 3
src/core/uuid.c Ver fichero

37
 	static char buf[37]; /* "00000000-0000-0000-0000-000000000000" */
37
 	static char buf[37]; /* "00000000-0000-0000-0000-000000000000" */
38
 
38
 
39
 	sprintf ( buf, "%08lx-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x",
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
 		  be16_to_cpu ( uuid->canonical.d ),
43
 		  be16_to_cpu ( uuid->canonical.d ),
44
 		  uuid->canonical.e[0], uuid->canonical.e[1],
44
 		  uuid->canonical.e[0], uuid->canonical.e[1],
45
 		  uuid->canonical.e[2], uuid->canonical.e[3],
45
 		  uuid->canonical.e[2], uuid->canonical.e[3],

+ 3
- 3
src/include/gpxe/uuid.h Ver fichero

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

Loading…
Cancelar
Guardar