Bluetooth: Report proper error number in disconnection
authorGustavo Padovan <gustavo@padovan.org>
Wed, 16 May 2012 15:17:12 +0000 (12:17 -0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 16 May 2012 19:14:24 +0000 (16:14 -0300)
If encryption change fails we should disconnect with auth failure error
code.

Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_event.c

index 9c60e0d8db5f6b1e101b5f8a53a2ad6f7a91ace9..4eefb7f65cf62e6409fb5b67d0fed541eed5b541 100644 (file)
@@ -2063,7 +2063,7 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *
                clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
 
                if (ev->status && conn->state == BT_CONNECTED) {
-                       hci_acl_disconn(conn, 0x13);
+                       hci_acl_disconn(conn, HCI_ERROR_AUTH_FAILURE);
                        hci_conn_put(conn);
                        goto unlock;
                }