Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225511
b: refs/heads/master
c: a40c406
h: refs/heads/master
i:
  225509: 3543265
  225507: 828c9d9
  225503: 3b70a2b
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo F. Padovan committed Dec 8, 2010
1 parent 1ed5c5d commit ac849dc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0381101fd6a73c7d6b545044dc1472d019fc64e3
refs/heads/master: a40c406cbdd28dcca3483065bc2ba794cf5aaab7
1 change: 1 addition & 0 deletions trunk/include/net/bluetooth/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ struct bt_skb_cb {
__u8 tx_seq;
__u8 retries;
__u8 sar;
unsigned short channel;
};
#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))

Expand Down
10 changes: 9 additions & 1 deletion trunk/net/bluetooth/hci_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
if (skb->sk == sk)
continue;

if (bt_cb(skb)->channel != hci_pi(sk)->channel)
continue;

if (bt_cb(skb)->channel == HCI_CHANNEL_CONTROL)
goto clone;

/* Apply filter */
flt = &hci_pi(sk)->filter;

Expand All @@ -127,12 +133,14 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
continue;
}

clone:
nskb = skb_clone(skb, GFP_ATOMIC);
if (!nskb)
continue;

/* Put type byte before the data */
memcpy(skb_push(nskb, 1), &bt_cb(nskb)->pkt_type, 1);
if (bt_cb(skb)->channel == HCI_CHANNEL_RAW)
memcpy(skb_push(nskb, 1), &bt_cb(nskb)->pkt_type, 1);

if (sock_queue_rcv_skb(sk, nskb))
kfree_skb(nskb);
Expand Down

0 comments on commit ac849dc

Please sign in to comment.