aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-06-21 13:52:56 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-06-21 13:52:56 -0400
commit0555891184a5c18df0e2349872e7ecf9701fc5b5 (patch)
tree4ce942176ec5605e81ecc3f1ed17930d852a1259 /net/bluetooth
parente13e21dc5d06bd9ed4a88daf057b8dbe80c220de (diff)
parent330605423ca6eafafb8dcc27502bce1c585d1b06 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/padovan/bluetooth-2.6
Conflicts: net/bluetooth/l2cap_core.c
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_conn.c6
-rw-r--r--net/bluetooth/l2cap_core.c23
2 files changed, 19 insertions, 10 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 2f5ae53057c7..fa48c0b3d93c 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -670,11 +670,11 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
670 goto encrypt; 670 goto encrypt;
671 671
672auth: 672auth:
673 if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) 673 if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
674 return 0; 674 return 0;
675 675
676 hci_conn_auth(conn, sec_level, auth_type); 676 if (!hci_conn_auth(conn, sec_level, auth_type))
677 return 0; 677 return 0;
678 678
679encrypt: 679encrypt:
680 if (conn->link_mode & HCI_LM_ENCRYPT) 680 if (conn->link_mode & HCI_LM_ENCRYPT)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 700d01e3d5ba..ba0b2f47bab8 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4212,21 +4212,30 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
4212 } 4212 }
4213 } else if (chan->state == BT_CONNECT2) { 4213 } else if (chan->state == BT_CONNECT2) {
4214 struct l2cap_conn_rsp rsp; 4214 struct l2cap_conn_rsp rsp;
4215 __u16 result; 4215 __u16 res, stat;
4216 4216
4217 if (!status) { 4217 if (!status) {
4218 l2cap_state_change(chan, BT_CONFIG); 4218 if (bt_sk(sk)->defer_setup) {
4219 result = L2CAP_CR_SUCCESS; 4219 struct sock *parent = bt_sk(sk)->parent;
4220 res = L2CAP_CR_PEND;
4221 stat = L2CAP_CS_AUTHOR_PEND;
4222 parent->sk_data_ready(parent, 0);
4223 } else {
4224 l2cap_state_change(chan, BT_CONFIG);
4225 res = L2CAP_CR_SUCCESS;
4226 stat = L2CAP_CS_NO_INFO;
4227 }
4220 } else { 4228 } else {
4221 l2cap_state_change(chan, BT_DISCONN); 4229 l2cap_state_change(chan, BT_DISCONN);
4222 __set_chan_timer(chan, HZ / 10); 4230 __set_chan_timer(chan, HZ / 10);
4223 result = L2CAP_CR_SEC_BLOCK; 4231 res = L2CAP_CR_SEC_BLOCK;
4232 stat = L2CAP_CS_NO_INFO;
4224 } 4233 }
4225 4234
4226 rsp.scid = cpu_to_le16(chan->dcid); 4235 rsp.scid = cpu_to_le16(chan->dcid);
4227 rsp.dcid = cpu_to_le16(chan->scid); 4236 rsp.dcid = cpu_to_le16(chan->scid);
4228 rsp.result = cpu_to_le16(result); 4237 rsp.result = cpu_to_le16(res);
4229 rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); 4238 rsp.status = cpu_to_le16(stat);
4230 l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP, 4239 l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP,
4231 sizeof(rsp), &rsp); 4240 sizeof(rsp), &rsp);
4232 } 4241 }
@@ -4365,7 +4374,7 @@ static int l2cap_debugfs_show(struct seq_file *f, void *p)
4365 c->state, __le16_to_cpu(c->psm), 4374 c->state, __le16_to_cpu(c->psm),
4366 c->scid, c->dcid, c->imtu, c->omtu, 4375 c->scid, c->dcid, c->imtu, c->omtu,
4367 c->sec_level, c->mode); 4376 c->sec_level, c->mode);
4368 } 4377}
4369 4378
4370 read_unlock_bh(&chan_list_lock); 4379 read_unlock_bh(&chan_list_lock);
4371 4380