conn->type = type;
conn->mode = HCI_CM_ACTIVE;
conn->state = BT_OPEN;
+ conn->auth_type = HCI_AT_GENERAL_BONDING;
conn->power_save = 1;
skb_queue_purge(&conn->data_q);
+ hci_conn_del_sysfs(conn);
+
return 0;
}
{
BT_DBG("conn %p", conn);
- if (sec_level > conn->sec_level) {
+ if (sec_level > conn->sec_level)
conn->sec_level = sec_level;
- conn->auth_type = auth_type;
- } else if (conn->link_mode & HCI_LM_AUTH)
+ else if (conn->link_mode & HCI_LM_AUTH)
return 1;
+ conn->auth_type = auth_type;
+
if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
struct hci_cp_auth_requested cp;
cp.handle = cpu_to_le16(conn->handle);
{
BT_DBG("conn %p", conn);
- if (conn->auth_type == 0xff)
- conn->auth_type = auth_type;
-
if (sec_level == BT_SECURITY_SDP)
return 1;
- if (sec_level == BT_SECURITY_LOW) {
- if (conn->ssp_mode > 0 && conn->hdev->ssp_mode > 0)
- return hci_conn_auth(conn, sec_level, auth_type);
- else
- return 1;
- }
+ if (sec_level == BT_SECURITY_LOW &&
+ (!conn->ssp_mode || !conn->hdev->ssp_mode))
+ return 1;
if (conn->link_mode & HCI_LM_ENCRYPT)
return hci_conn_auth(conn, sec_level, auth_type);
c->state = BT_CLOSED;
- hci_conn_del_sysfs(c);
-
hci_proto_disconn_cfm(c, 0x16);
hci_conn_del(c);
}