diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-03-02 13:31:23 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-03-02 14:27:21 +0200 |
commit | 232015aeefd1c945ccfaf9744e791c5888eafcf7 (patch) | |
tree | 779f4118ca01050143a403e9c1ad89bf67573377 /lib/uuid.c | |
parent | db6e9fcc192d1a7fb932522899ccb96a4c37e0b4 (diff) | |
download | bluez-232015aeefd1c945ccfaf9744e791c5888eafcf7.tar.gz |
lib/uuid: Fix bt_uuid_to_le for 128 Bits
The convention is that 128 Bits are always defined in big endian format
therefore the bytes always needs to be swapped.
Diffstat (limited to 'lib/uuid.c')
-rw-r--r-- | lib/uuid.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/uuid.c b/lib/uuid.c index 3eb7dbea2..4f34b17f4 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -302,10 +302,10 @@ int bt_uuid_to_le(const bt_uuid_t *src, void *dst) return 0; case BT_UUID32: bt_uuid_to_uuid128(src, &uuid); - ntoh128(&uuid.value.u128, dst); - return 0; + /* Fallthrough */ case BT_UUID128: - ntoh128(&src->value.u128, dst); + /* Convert from 128-bit BE to LE */ + bswap_128(&src->value.u128, dst); return 0; case BT_UUID_UNSPEC: default: |