public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Mat Martineau <mathewm@codeaurora.org>
To: Gustavo Padovan <gustavo@padovan.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] Bluetooth: Fix packet size informed to the controller
Date: Wed, 9 May 2012 09:22:34 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1205090919280.2090@mathewm-linux> (raw)
In-Reply-To: <1336569159-4710-1-git-send-email-gustavo@padovan.org>


Gustavo -

On Wed, 9 May 2012, Gustavo Padovan wrote:

> skb->len is the wrong var to tell the size of a packet, skb->len keeps the
> size of the overall skb, including its head and fragments, then when
> sending the head the wrong size is passed if the we have a framented skb.
> We fix this by using skb_datalen(skb) which is the total skb size minus
> the fragments size, i.e., the actual head size.
>
> 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>
> ---
> drivers/bluetooth/bluecard_cs.c |    5 +++--
> drivers/bluetooth/bpa10x.c      |    4 ++--
> drivers/bluetooth/bt3c_cs.c     |    4 ++--
> drivers/bluetooth/btusb.c       |    4 ++--
> drivers/bluetooth/btwilink.c    |    2 +-
> drivers/bluetooth/dtl1_cs.c     |   13 +++++++------
> drivers/bluetooth/hci_bcsp.c    |    8 ++++++--
> drivers/bluetooth/hci_ldisc.c   |    7 ++++---
> drivers/bluetooth/hci_vhci.c    |    2 +-
> net/bluetooth/hci_core.c        |    2 +-
> 10 files changed, 29 insertions(+), 22 deletions(-)

The drivers should never see fragmented skbs, so this change should 
not be necessary.  See my reply to the next patch for the full 
background information.

--
Mat Martineau
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 13:12 [PATCH 1/2] Bluetooth: Fix packet size informed to the controller Gustavo Padovan
2012-05-09 13:12 ` [PATCH 2/2] Bluetooth: Fix skb length calculation Gustavo Padovan
2012-05-09 16:27   ` Mat Martineau
2012-05-09 18:48     ` Gustavo Padovan
2012-05-09 20:20       ` Mat Martineau
2012-05-09 16:22 ` Mat Martineau [this message]

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=alpine.DEB.2.02.1205090919280.2090@mathewm-linux \
    --to=mathewm@codeaurora.org \
    --cc=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