|
@@ -5568,6 +5568,8 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
|
|
|
int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
|
|
|
{
|
|
|
struct l2cap_conn *conn = hcon->l2cap_data;
|
|
|
+ struct l2cap_hdr *hdr;
|
|
|
+ int len;
|
|
|
|
|
|
if (!conn)
|
|
|
conn = l2cap_conn_add(hcon, 0);
|
|
@@ -5577,10 +5579,10 @@ int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
|
|
|
|
|
|
BT_DBG("conn %p len %d flags 0x%x", conn, skb->len, flags);
|
|
|
|
|
|
- if (!(flags & ACL_CONT)) {
|
|
|
- struct l2cap_hdr *hdr;
|
|
|
- int len;
|
|
|
-
|
|
|
+ switch (flags) {
|
|
|
+ case ACL_START:
|
|
|
+ case ACL_START_NO_FLUSH:
|
|
|
+ case ACL_COMPLETE:
|
|
|
if (conn->rx_len) {
|
|
|
BT_ERR("Unexpected start frame (len %d)", skb->len);
|
|
|
kfree_skb(conn->rx_skb);
|
|
@@ -5622,7 +5624,9 @@ int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
|
|
|
skb_copy_from_linear_data(skb, skb_put(conn->rx_skb, skb->len),
|
|
|
skb->len);
|
|
|
conn->rx_len = len - skb->len;
|
|
|
- } else {
|
|
|
+ break;
|
|
|
+
|
|
|
+ case ACL_CONT:
|
|
|
BT_DBG("Cont: frag len %d (expecting %d)", skb->len, conn->rx_len);
|
|
|
|
|
|
if (!conn->rx_len) {
|
|
@@ -5650,6 +5654,7 @@ int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
|
|
|
l2cap_recv_frame(conn, conn->rx_skb);
|
|
|
conn->rx_skb = NULL;
|
|
|
}
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
drop:
|