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 7b3acdd..ca356a7 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 deb1198..6fc7c47 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);