Thread (31 messages) 31 messages, 5 authors, 2011-02-22

[RFC v2 04/14] Convert UUID128 value to host order when extracting SDP data

From: Claudio Takahasi <hidden>
Date: 2011-02-18 22:29:23
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

---
 lib/sdp.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/lib/sdp.c b/lib/sdp.c
index af50a16..d5f8984 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -1031,11 +1031,16 @@ int sdp_uuid_extract(const uint8_t *p, int bufsize, uuid_t *uuid, int *scanned)
 		*scanned += sizeof(uint32_t);
 		p += sizeof(uint32_t);
 	} else {
+		uint128_t n128, h128;
+
 		if (bufsize < (int) sizeof(uint128_t)) {
 			SDPERR("Not enough room for 128-bit UUID");
 			return -1;
 		}
-		sdp_uuid128_create(uuid, p);
+
+		memcpy(&n128, p, sizeof(uint128_t));
+		ntoh128(&n128, &h128);
+		sdp_uuid128_create(uuid, &h128);
 		*scanned += sizeof(uint128_t);
 		p += sizeof(uint128_t);
 	}
-- 
1.7.4.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help