Bluetooth: Correct ediv in SMP
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Mon, 12 Mar 2012 10:13:06 +0000 (12:13 +0200)
committerGustavo Padovan <gustavo@padovan.org>
Wed, 9 May 2012 03:41:30 +0000 (00:41 -0300)
ediv is already in little endian order.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
include/net/bluetooth/smp.h
net/bluetooth/smp.c

index 7b3acdd29134df26025d4a79460a4d113ad7dabe..ca356a7349202272236b9d7db421f6d8804d89a5 100644 (file)
@@ -77,7 +77,7 @@ struct smp_cmd_encrypt_info {
 
 #define SMP_CMD_MASTER_IDENT   0x07
 struct smp_cmd_master_ident {
-       __u16   ediv;
+       __le16  ediv;
        __u8    rand[8];
 } __packed;
 
index deb119875fd93aee3fa125ecfd49de66495b7786..6fc7c4708f3e1fa6336a434ef8c63d072e262d5a 100644 (file)
@@ -956,7 +956,7 @@ int smp_distribute_keys(struct l2cap_conn *conn, __u8 force)
                            HCI_SMP_LTK_SLAVE, 1, authenticated,
                            enc.ltk, smp->enc_key_size, ediv, ident.rand);
 
-               ident.ediv = cpu_to_le16(ediv);
+               ident.ediv = ediv;
 
                smp_send_cmd(conn, SMP_CMD_MASTER_IDENT, sizeof(ident), &ident);