diff options
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index bd77f54d91f7..6c924f24b3d9 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1333,7 +1333,8 @@ static void pairing_complete(struct pending_cmd *cmd, u8 status) | |||
1333 | struct mgmt_rp_pair_device rp; | 1333 | struct mgmt_rp_pair_device rp; |
1334 | struct hci_conn *conn = cmd->user_data; | 1334 | struct hci_conn *conn = cmd->user_data; |
1335 | 1335 | ||
1336 | bacpy(&rp.bdaddr, &conn->dst); | 1336 | bacpy(&rp.addr.bdaddr, &conn->dst); |
1337 | rp.addr.type = link_to_mgmt(conn->type, conn->dst_type); | ||
1337 | rp.status = status; | 1338 | rp.status = status; |
1338 | 1339 | ||
1339 | cmd_complete(cmd->sk, cmd->index, MGMT_OP_PAIR_DEVICE, &rp, sizeof(rp)); | 1340 | cmd_complete(cmd->sk, cmd->index, MGMT_OP_PAIR_DEVICE, &rp, sizeof(rp)); |
@@ -1366,7 +1367,6 @@ static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
1366 | struct hci_dev *hdev; | 1367 | struct hci_dev *hdev; |
1367 | struct mgmt_cp_pair_device *cp; | 1368 | struct mgmt_cp_pair_device *cp; |
1368 | struct pending_cmd *cmd; | 1369 | struct pending_cmd *cmd; |
1369 | struct adv_entry *entry; | ||
1370 | u8 sec_level, auth_type; | 1370 | u8 sec_level, auth_type; |
1371 | struct hci_conn *conn; | 1371 | struct hci_conn *conn; |
1372 | int err; | 1372 | int err; |
@@ -1390,12 +1390,11 @@ static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
1390 | else | 1390 | else |
1391 | auth_type = HCI_AT_DEDICATED_BONDING_MITM; | 1391 | auth_type = HCI_AT_DEDICATED_BONDING_MITM; |
1392 | 1392 | ||
1393 | entry = hci_find_adv_entry(hdev, &cp->bdaddr); | 1393 | if (cp->addr.type == MGMT_ADDR_BREDR) |
1394 | if (entry) | 1394 | conn = hci_connect(hdev, ACL_LINK, &cp->addr.bdaddr, sec_level, |
1395 | conn = hci_connect(hdev, LE_LINK, &cp->bdaddr, sec_level, | ||
1396 | auth_type); | 1395 | auth_type); |
1397 | else | 1396 | else |
1398 | conn = hci_connect(hdev, ACL_LINK, &cp->bdaddr, sec_level, | 1397 | conn = hci_connect(hdev, LE_LINK, &cp->addr.bdaddr, sec_level, |
1399 | auth_type); | 1398 | auth_type); |
1400 | 1399 | ||
1401 | if (IS_ERR(conn)) { | 1400 | if (IS_ERR(conn)) { |
@@ -1417,7 +1416,7 @@ static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
1417 | } | 1416 | } |
1418 | 1417 | ||
1419 | /* For LE, just connecting isn't a proof that the pairing finished */ | 1418 | /* For LE, just connecting isn't a proof that the pairing finished */ |
1420 | if (!entry) | 1419 | if (cp->addr.type == MGMT_ADDR_BREDR) |
1421 | conn->connect_cfm_cb = pairing_complete_cb; | 1420 | conn->connect_cfm_cb = pairing_complete_cb; |
1422 | 1421 | ||
1423 | conn->security_cfm_cb = pairing_complete_cb; | 1422 | conn->security_cfm_cb = pairing_complete_cb; |