aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_event.c6
-rw-r--r--net/bluetooth/mgmt.c6
-rw-r--r--net/bluetooth/smp.c5
3 files changed, 12 insertions, 5 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 3bf3f4d59bcc..b0784ee5f8b9 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1901,7 +1901,8 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
1901 conn->sec_level = conn->pending_sec_level; 1901 conn->sec_level = conn->pending_sec_level;
1902 } 1902 }
1903 } else { 1903 } else {
1904 mgmt_auth_failed(hdev, &conn->dst, ev->status); 1904 mgmt_auth_failed(hdev, &conn->dst, conn->type, conn->dst_type,
1905 ev->status);
1905 } 1906 }
1906 1907
1907 clear_bit(HCI_CONN_AUTH_PEND, &conn->flags); 1908 clear_bit(HCI_CONN_AUTH_PEND, &conn->flags);
@@ -3166,7 +3167,8 @@ static inline void hci_simple_pair_complete_evt(struct hci_dev *hdev, struct sk_
3166 * event gets always produced as initiator and is also mapped to 3167 * event gets always produced as initiator and is also mapped to
3167 * the mgmt_auth_failed event */ 3168 * the mgmt_auth_failed event */
3168 if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) && ev->status != 0) 3169 if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) && ev->status != 0)
3169 mgmt_auth_failed(hdev, &conn->dst, ev->status); 3170 mgmt_auth_failed(hdev, &conn->dst, conn->type, conn->dst_type,
3171 ev->status);
3170 3172
3171 hci_conn_put(conn); 3173 hci_conn_put(conn);
3172 3174
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 413a0b97c533..545919828562 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2841,11 +2841,13 @@ int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
2841 status, MGMT_OP_USER_PASSKEY_NEG_REPLY); 2841 status, MGMT_OP_USER_PASSKEY_NEG_REPLY);
2842} 2842}
2843 2843
2844int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 status) 2844int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
2845 u8 addr_type, u8 status)
2845{ 2846{
2846 struct mgmt_ev_auth_failed ev; 2847 struct mgmt_ev_auth_failed ev;
2847 2848
2848 bacpy(&ev.bdaddr, bdaddr); 2849 bacpy(&ev.addr.bdaddr, bdaddr);
2850 ev.addr.type = link_to_mgmt(link_type, addr_type);
2849 ev.status = mgmt_status(status); 2851 ev.status = mgmt_status(status);
2850 2852
2851 return mgmt_event(MGMT_EV_AUTH_FAILED, hdev, &ev, sizeof(ev), NULL); 2853 return mgmt_event(MGMT_EV_AUTH_FAILED, hdev, &ev, sizeof(ev), NULL);
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 589766d06f22..f6a6d8be3051 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -257,12 +257,15 @@ static u8 check_enc_key_size(struct l2cap_conn *conn, __u8 max_key_size)
257 257
258static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send) 258static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send)
259{ 259{
260 struct hci_conn *hcon = conn->hcon;
261
260 if (send) 262 if (send)
261 smp_send_cmd(conn, SMP_CMD_PAIRING_FAIL, sizeof(reason), 263 smp_send_cmd(conn, SMP_CMD_PAIRING_FAIL, sizeof(reason),
262 &reason); 264 &reason);
263 265
264 clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->flags); 266 clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->flags);
265 mgmt_auth_failed(conn->hcon->hdev, conn->dst, reason); 267 mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type,
268 hcon->dst_type, reason);
266 269
267 if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) { 270 if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) {
268 cancel_delayed_work_sync(&conn->security_timer); 271 cancel_delayed_work_sync(&conn->security_timer);