aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-06-09 07:41:25 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-06-13 07:30:45 -0400
commit4ad51a75c70ba1ba6802fa7ff2ee6829b1c6e61a (patch)
treebfab2aa2fdac88e2c16b6de9f979d16224b39e1a
parentba15a58b179ed76a7e887177f2b06de12c58ec8f (diff)
Bluetooth: Add clarifying comment for conn->auth_type
When responding to an IO capability request when we're the initiators of the pairing we will not yet have the remote IO capability information. Since the conn->auth_type variable is treated as an "absolute" requirement instead of a hint of what's needed later in the user confirmation request handler it's important that it doesn't have the MITM bit set if there's any chance that the remote device doesn't have the necessary IO capabilities. This patch adds a clarifying comment so that conn->auth_type is left untouched in this scenario. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/hci_event.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ff11f4a1ada3..3183edc25769 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3537,7 +3537,11 @@ static void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
3537 cp.authentication = conn->auth_type; 3537 cp.authentication = conn->auth_type;
3538 3538
3539 /* Request MITM protection if our IO caps allow it 3539 /* Request MITM protection if our IO caps allow it
3540 * except for the no-bonding case 3540 * except for the no-bonding case.
3541 * conn->auth_type is not updated here since
3542 * that might cause the user confirmation to be
3543 * rejected in case the remote doesn't have the
3544 * IO capabilities for MITM.
3541 */ 3545 */
3542 if (conn->io_capability != HCI_IO_NO_INPUT_OUTPUT && 3546 if (conn->io_capability != HCI_IO_NO_INPUT_OUTPUT &&
3543 cp.authentication != HCI_AT_NO_BONDING) 3547 cp.authentication != HCI_AT_NO_BONDING)