[PATCH BlueZ] lib/uuid: Fix bt_uuid_to_le

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

bt_uuid_to_le is currently broken if the src uuid is type 32 bits since
it does the conversion to 128 bits but still uses the original value to
swap instead of the coverted one.
---
 lib/uuid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/uuid.c b/lib/uuid.c
index 4f34b17..fd61968 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -301,7 +301,8 @@ int bt_uuid_to_le(const bt_uuid_t *src, void *dst)
 		bt_put_le16(src->value.u16, dst);
 		return 0;
 	case BT_UUID32:
-		bt_uuid_to_uuid128(src, &uuid);
+		bt_uuid32_to_uuid128(src, &uuid);
+		src = &uuid;
 		/* Fallthrough */
 	case BT_UUID128:
 		/* Convert from 128-bit BE to LE */
-- 
2.1.0

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