aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo@padovan.org>2012-05-11 12:16:11 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-05-16 15:12:49 -0400
commit087bfd99f75c5f7d5430e7e122c2f288f03d6c23 (patch)
tree46800ec29eadddfe157e0cc5c6f095b2eb8b6350 /net
parentfbe0070092c3968927c63ab56c00b47c6aa3770f (diff)
Bluetooth: Fix packet size provided to the controller
When building fragmented skb's skb->len keeps track of the size of head plus all fragments combined, however when queueing the skb for sending we need to report the head size instead of the total size, so we just set skb->len to skb_headlen(). This bug appeared when implementing MSG_MORE support for L2CAP sockets, it never showed up before because l2cap_skbuff_fromiovec() never accounted skb size correctly. A following patch will fix this. Signed-off-by: Gustavo Padovan <gustavo@padovan.org> Reviewed-by: Mat Martineau <mathewm@codeaurora.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_core.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index a8962382f9c5..411ace8e647b 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2162,6 +2162,12 @@ static void hci_queue_acl(struct hci_conn *conn, struct sk_buff_head *queue,
2162 struct hci_dev *hdev = conn->hdev; 2162 struct hci_dev *hdev = conn->hdev;
2163 struct sk_buff *list; 2163 struct sk_buff *list;
2164 2164
2165 skb->len = skb_headlen(skb);
2166 skb->data_len = 0;
2167
2168 bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT;
2169 hci_add_acl_hdr(skb, conn->handle, flags);
2170
2165 list = skb_shinfo(skb)->frag_list; 2171 list = skb_shinfo(skb)->frag_list;
2166 if (!list) { 2172 if (!list) {
2167 /* Non fragmented */ 2173 /* Non fragmented */
@@ -2205,8 +2211,6 @@ void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags)
2205 BT_DBG("%s chan %p flags 0x%x", hdev->name, chan, flags); 2211 BT_DBG("%s chan %p flags 0x%x", hdev->name, chan, flags);
2206 2212
2207 skb->dev = (void *) hdev; 2213 skb->dev = (void *) hdev;
2208 bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT;
2209 hci_add_acl_hdr(skb, conn->handle, flags);
2210 2214
2211 hci_queue_acl(conn, &chan->data_q, skb, flags); 2215 hci_queue_acl(conn, &chan->data_q, skb, flags);
2212 2216