Bluetooth: Fix drop of acked packets on ERTM
authorGustavo F. Padovan <padovan@profusion.mobi>
Sat, 1 May 2010 19:15:42 +0000 (16:15 -0300)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 10 May 2010 07:28:50 +0000 (09:28 +0200)
l2cap_drop_acked_frames() was droping not sent packets, causing them to
be not transmitted.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap.c

index 2f9bbad428872700f1f33843c121ab9bab677fe6..042fd967e79c2352771ec6e18e042e05cdcfbfc3 100644 (file)
@@ -1262,7 +1262,8 @@ static void l2cap_drop_acked_frames(struct sock *sk)
 {
        struct sk_buff *skb;
 
-       while ((skb = skb_peek(TX_QUEUE(sk)))) {
+       while ((skb = skb_peek(TX_QUEUE(sk))) &&
+                       l2cap_pi(sk)->unacked_frames) {
                if (bt_cb(skb)->tx_seq == l2cap_pi(sk)->expected_ack_seq)
                        break;