diff options
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 21e5913d12e0..640c54ec1bd2 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -48,6 +48,10 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) | |||
48 | smp_mb__after_atomic(); /* wake_up_bit advises about this barrier */ | 48 | smp_mb__after_atomic(); /* wake_up_bit advises about this barrier */ |
49 | wake_up_bit(&hdev->flags, HCI_INQUIRY); | 49 | wake_up_bit(&hdev->flags, HCI_INQUIRY); |
50 | 50 | ||
51 | hci_dev_lock(hdev); | ||
52 | hci_discovery_set_state(hdev, DISCOVERY_STOPPED); | ||
53 | hci_dev_unlock(hdev); | ||
54 | |||
51 | hci_conn_check_pending(hdev); | 55 | hci_conn_check_pending(hdev); |
52 | } | 56 | } |
53 | 57 | ||
@@ -3537,7 +3541,11 @@ static void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
3537 | cp.authentication = conn->auth_type; | 3541 | cp.authentication = conn->auth_type; |
3538 | 3542 | ||
3539 | /* Request MITM protection if our IO caps allow it | 3543 | /* Request MITM protection if our IO caps allow it |
3540 | * except for the no-bonding case | 3544 | * except for the no-bonding case. |
3545 | * conn->auth_type is not updated here since | ||
3546 | * that might cause the user confirmation to be | ||
3547 | * rejected in case the remote doesn't have the | ||
3548 | * IO capabilities for MITM. | ||
3541 | */ | 3549 | */ |
3542 | if (conn->io_capability != HCI_IO_NO_INPUT_OUTPUT && | 3550 | if (conn->io_capability != HCI_IO_NO_INPUT_OUTPUT && |
3543 | cp.authentication != HCI_AT_NO_BONDING) | 3551 | cp.authentication != HCI_AT_NO_BONDING) |
@@ -3628,8 +3636,11 @@ static void hci_user_confirm_request_evt(struct hci_dev *hdev, | |||
3628 | 3636 | ||
3629 | /* If we're not the initiators request authorization to | 3637 | /* If we're not the initiators request authorization to |
3630 | * proceed from user space (mgmt_user_confirm with | 3638 | * proceed from user space (mgmt_user_confirm with |
3631 | * confirm_hint set to 1). */ | 3639 | * confirm_hint set to 1). The exception is if neither |
3632 | if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags)) { | 3640 | * side had MITM in which case we do auto-accept. |
3641 | */ | ||
3642 | if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) && | ||
3643 | (loc_mitm || rem_mitm)) { | ||
3633 | BT_DBG("Confirming auto-accept as acceptor"); | 3644 | BT_DBG("Confirming auto-accept as acceptor"); |
3634 | confirm_hint = 1; | 3645 | confirm_hint = 1; |
3635 | goto confirm; | 3646 | goto confirm; |