aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>2014-08-14 03:35:34 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-08-14 03:47:02 -0400
commit13cac15296afe7e42088ecfcd0f1d4b658248c46 (patch)
tree01fd55d3acafa9d6401b50d787fbebea1e951759 /net/bluetooth
parent069cb27017de6476d47a70fbf144f69200d3e854 (diff)
Bluetooth: Fix ERTM L2CAP resend packet
I-Frame which is going to be resend already has FCS field added and set (if it was required). Adding additional FCS field calculated from data + old FCS in resend function is incorrect. This patch fix that. Issue has been found during PTS testing. Signed-off-by: Lukasz Rymanowski <lukasz.rymanowski@tieto.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap_core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index ebe7454362f0..4a90438d99df 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1968,10 +1968,12 @@ static void l2cap_ertm_resend(struct l2cap_chan *chan)
1968 tx_skb->data + L2CAP_HDR_SIZE); 1968 tx_skb->data + L2CAP_HDR_SIZE);
1969 } 1969 }
1970 1970
1971 /* Update FCS */
1971 if (chan->fcs == L2CAP_FCS_CRC16) { 1972 if (chan->fcs == L2CAP_FCS_CRC16) {
1972 u16 fcs = crc16(0, (u8 *) tx_skb->data, tx_skb->len); 1973 u16 fcs = crc16(0, (u8 *) tx_skb->data,
1973 put_unaligned_le16(fcs, skb_put(tx_skb, 1974 tx_skb->len - L2CAP_FCS_SIZE);
1974 L2CAP_FCS_SIZE)); 1975 put_unaligned_le16(fcs, skb_tail_pointer(tx_skb) -
1976 L2CAP_FCS_SIZE);
1975 } 1977 }
1976 1978
1977 l2cap_do_send(chan, tx_skb); 1979 l2cap_do_send(chan, tx_skb);