From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Sender: "Gustavo F. Padovan" From: "Gustavo F. Padovan" To: linux-bluetooth@vger.kernel.org Cc: gustavo@padovan.org, marcel@holtmann.org, "Gustavo F. Padovan" Subject: [PATCH 07/14] Bluetooth: Only check SAR bits if frame is I-frame Date: Sat, 5 Jun 2010 04:50:11 -0300 Message-Id: <1275724218-29453-8-git-send-email-gustavo@padovan.org> In-Reply-To: <1275724218-29453-7-git-send-email-gustavo@padovan.org> References: <1275724218-29453-1-git-send-email-gustavo@padovan.org> <1275724218-29453-2-git-send-email-gustavo@padovan.org> <1275724218-29453-3-git-send-email-gustavo@padovan.org> <1275724218-29453-4-git-send-email-gustavo@padovan.org> <1275724218-29453-5-git-send-email-gustavo@padovan.org> <1275724218-29453-6-git-send-email-gustavo@padovan.org> <1275724218-29453-7-git-send-email-gustavo@padovan.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 List-ID: From: Gustavo F. Padovan Check the SAR bit only make sense for an I-frame. Also check SAR for S-frame lead to errors. Signed-off-by: Gustavo F. Padovan Reviewed-by: João Paulo Rechi Vita --- net/bluetooth/l2cap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 97584d8..7a8454a 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -4122,7 +4122,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk if (l2cap_check_fcs(pi, skb)) goto drop; - if (__is_sar_start(control)) + if (__is_sar_start(control) && __is_iframe(control)) len -= 2; if (pi->fcs == L2CAP_FCS_CRC16) -- 1.7.1