diff options
author | John W. Linville <linville@tuxdriver.com> | 2013-02-04 16:40:07 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-02-04 16:40:07 -0500 |
commit | 4c52d3d3fdef532a6e372865d1f15632abf5fc82 (patch) | |
tree | 6617d25d507b8c3a3d2bd10f28acf6d678833fe4 | |
parent | 8a7d7cbf7b5ff9912ef50b3e94c9ad9f37b1c75f (diff) | |
parent | 4c02e2d444595200d0b18b889994aac3611cd288 (diff) |
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
-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) | |||
249 | __u8 reason = hci_proto_disconn_ind(conn); | 249 | __u8 reason = hci_proto_disconn_ind(conn); |
250 | 250 | ||
251 | switch (conn->type) { | 251 | switch (conn->type) { |
252 | case ACL_LINK: | ||
253 | hci_acl_disconn(conn, reason); | ||
254 | break; | ||
255 | case AMP_LINK: | 252 | case AMP_LINK: |
256 | hci_amp_disconn(conn, reason); | 253 | hci_amp_disconn(conn, reason); |
257 | break; | 254 | break; |
255 | default: | ||
256 | hci_acl_disconn(conn, reason); | ||
257 | break; | ||
258 | } | 258 | } |
259 | } | 259 | } |
260 | 260 | ||
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) | |||
859 | 859 | ||
860 | skb_pull(skb, sizeof(code)); | 860 | skb_pull(skb, sizeof(code)); |
861 | 861 | ||
862 | /* | ||
863 | * The SMP context must be initialized for all other PDUs except | ||
864 | * pairing and security requests. If we get any other PDU when | ||
865 | * not initialized simply disconnect (done if this function | ||
866 | * returns an error). | ||
867 | */ | ||
868 | if (code != SMP_CMD_PAIRING_REQ && code != SMP_CMD_SECURITY_REQ && | ||
869 | !conn->smp_chan) { | ||
870 | BT_ERR("Unexpected SMP command 0x%02x. Disconnecting.", code); | ||
871 | kfree_skb(skb); | ||
872 | return -ENOTSUPP; | ||
873 | } | ||
874 | |||
862 | switch (code) { | 875 | switch (code) { |
863 | case SMP_CMD_PAIRING_REQ: | 876 | case SMP_CMD_PAIRING_REQ: |
864 | reason = smp_cmd_pairing_req(conn, skb); | 877 | reason = smp_cmd_pairing_req(conn, skb); |