summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2010-05-12 01:14:00 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2010-07-21 17:39:04 (GMT)
commitbc1b1f8bee63966649dd5ac7d10d31a6556bf19b (patch)
tree5560ff18797eefa7db245f64acaa813091504dcc
parent8ff50ec04a7ecdbba6e0a5423cf6f2c5f7fc605e (diff)
downloadlinux-bc1b1f8bee63966649dd5ac7d10d31a6556bf19b.tar.xz
Bluetooth: Only check SAR bits if frame is an I-frame
The SAR bits doesn't make sense for an S-frame. It doesn't use SAR. Checking SAR for a S-frames can lead to L2CAP errors, it could close the channel with an invalid packet length, since we was removing the 2 of the of any frame that match SAR start bits, without check if it is an I-frame. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/l2cap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index a9fdfe4..108c2f2 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -4117,7 +4117,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
skb_pull(skb, 2);
len = skb->len;
- if (__is_sar_start(control))
+ if (__is_sar_start(control) && __is_iframe(control))
len -= 2;
if (pi->fcs == L2CAP_FCS_CRC16)