linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATC -v2 1/2] Bluetooth: Fix packet size informed to the controller
Date: Wed, 9 May 2012 19:30:21 -0300	[thread overview]
Message-ID: <20120509223021.GB28375@joana> (raw)
In-Reply-To: <1336598836-28478-1-git-send-email-gustavo@padovan.org>

Hah! it should be "PATCH" actually :)

* Gustavo Padovan <gustavo@padovan.org> [2012-05-09 18:27:15 -0300]:

> 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>
> ---
>  net/bluetooth/hci_core.c |    8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index a492b374..a7208e8 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,
>  	struct hci_dev *hdev = conn->hdev;
>  	struct sk_buff *list;
>  
> +	skb->len = skb_headlen(skb);
> +	skb->data_len = 0;
> +
> +	bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT;
> +	hci_add_acl_hdr(skb, conn->handle, flags);
> +
>  	list = skb_shinfo(skb)->frag_list;
>  	if (!list) {
>  		/* Non fragmented */
> @@ -2205,8 +2211,6 @@ void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags)
>  	BT_DBG("%s chan %p flags 0x%x", hdev->name, chan, flags);
>  
>  	skb->dev = (void *) hdev;
> -	bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT;
> -	hci_add_acl_hdr(skb, conn->handle, flags);
>  
>  	hci_queue_acl(conn, &chan->data_q, skb, flags);
>  
> -- 
> 1.7.10.1
> 

	Gustavo

  parent reply	other threads:[~2012-05-09 22:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 21:27 [PATC -v2 1/2] Bluetooth: Fix packet size informed to the controller Gustavo Padovan
2012-05-09 21:27 ` [PATC -v2 2/2] Bluetooth: Fix skb length calculation Gustavo Padovan
2012-05-09 23:28   ` Mat Martineau
2012-05-09 23:41     ` Gustavo Padovan
2012-05-09 22:30 ` Gustavo Padovan [this message]
2012-05-09 23:27 ` [PATC -v2 1/2] Bluetooth: Fix packet size informed to the controller Mat Martineau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120509223021.GB28375@joana \
    --to=gustavo@padovan.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).