Bluetooth: Fix updating conn->auth_type in hci_io_capa_request_evt
authorJohan Hedberg <johan.hedberg@nokia.com>
Thu, 28 Apr 2011 18:29:04 +0000 (11:29 -0700)
committerGustavo F. Padovan <padovan@profusion.mobi>
Thu, 28 Apr 2011 19:14:44 +0000 (16:14 -0300)
In some circumstances hci_get_auth_req will return a value different
from the current conn->auth_type. In these cases update conn->auth_type
so that when a user confirm request comes it doesn't falsely trigger
auto-accept.

Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/hci_event.c

index 8a63d3a463f770f615e53394b5446bb7d2cf1dec..d5aa97ee6ffae4ef03e4abce779470d963a957b3 100644 (file)
@@ -2447,7 +2447,8 @@ static inline void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff
 
                bacpy(&cp.bdaddr, &ev->bdaddr);
                cp.capability = conn->io_capability;
-               cp.authentication = hci_get_auth_req(conn);
+               conn->auth_type = hci_get_auth_req(conn);
+               cp.authentication = conn->auth_type;
 
                if ((conn->out == 0x01 || conn->remote_oob == 0x01) &&
                                hci_find_remote_oob_data(hdev, &conn->dst))