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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux