diff options
author | John W. Linville <linville@tuxdriver.com> | 2013-02-06 13:55:44 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-02-06 13:55:44 -0500 |
commit | b3b66ae4c8aff0636521034d824b8953dc617335 (patch) | |
tree | 0a4c792efd730a59adc79d0d2476e0a4b3aa2f2e /net | |
parent | bf414b369f158bb527f9f29174ada815f961b44c (diff) | |
parent | 7b2385b95363c9ff49801c19cba2489a05bd6672 (diff) | |
download | blackbird-op-linux-b3b66ae4c8aff0636521034d824b8953dc617335.tar.gz blackbird-op-linux-b3b66ae4c8aff0636521034d824b8953dc617335.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_conn.c | 6 | ||||
-rw-r--r-- | net/bluetooth/smp.c | 13 |
2 files changed, 16 insertions, 3 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 25bfce0666eb..4925a02ae7e4 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -249,12 +249,12 @@ static void hci_conn_disconnect(struct hci_conn *conn) __u8 reason = hci_proto_disconn_ind(conn); switch (conn->type) { - case ACL_LINK: - hci_acl_disconn(conn, reason); - break; case AMP_LINK: hci_amp_disconn(conn, reason); break; + default: + hci_acl_disconn(conn, reason); + break; } } diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 68a9587c9694..5abefb12891d 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -859,6 +859,19 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb) skb_pull(skb, sizeof(code)); + /* + * The SMP context must be initialized for all other PDUs except + * pairing and security requests. If we get any other PDU when + * not initialized simply disconnect (done if this function + * returns an error). + */ + if (code != SMP_CMD_PAIRING_REQ && code != SMP_CMD_SECURITY_REQ && + !conn->smp_chan) { + BT_ERR("Unexpected SMP command 0x%02x. Disconnecting.", code); + kfree_skb(skb); + return -ENOTSUPP; + } + switch (code) { case SMP_CMD_PAIRING_REQ: reason = smp_cmd_pairing_req(conn, skb); |