提交 bc1b1f8b 编写于 作者: G Gustavo F. Padovan 提交者: Marcel Holtmann

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: NGustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 8ff50ec0
...@@ -4117,7 +4117,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk ...@@ -4117,7 +4117,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
skb_pull(skb, 2); skb_pull(skb, 2);
len = skb->len; len = skb->len;
if (__is_sar_start(control)) if (__is_sar_start(control) && __is_iframe(control))
len -= 2; len -= 2;
if (pi->fcs == L2CAP_FCS_CRC16) if (pi->fcs == L2CAP_FCS_CRC16)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册