浏览代码

[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 年前
父节点
当前提交
30cd348689
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 3
    3
      src/core/uuid.c
  2. 3
    3
      src/include/gpxe/uuid.h

+ 3
- 3
src/core/uuid.c 查看文件

@@ -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 查看文件

@@ -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;

正在加载...
取消
保存