Bluetooth: Fix l2cap_tx_window_full
Subsystems (2)
Luiz Augusto von Dentz
maintainerPATCH 1/1 Bluetooth: Fix l2cap_tx_window_full
From: Luiz Augusto von Dentz <[email protected]>
l2cap_tx_window_full is not checking the window limit properly, first it computes based on sequence numbers which doesn't take into account the ReqSeq and always assume 64 not the real window size.
To fix this now it just checks if the number of unacked frames is >= of tx window which is much simpler.
Signed-off-by Luiz Augusto von Dentz <[email protected]>
--- include/net/bluetooth/l2cap.h | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-)
include/net/bluetooth/l2cap.h +1 -8
@@ -661,14 +661,7 @@ static inline __u16 __next_seq(struct l2cap_chan *chan, __u16 seq)static inline int l2cap_tx_window_full (struct l2cap_chan *ch) { -int sub; - - sub = (ch->next_tx_seq - ch->expected_ack_seq) %64 ; - -if (sub <0 ) - sub +=64 ; - -return sub == ch->remote_tx_win; +return ch->unacked_frames >= ch->remote_tx_win; }static inline __u16 __get_reqseq (struct l2cap_chan *chan,__u32 ctrl)
Signature · 1 line
1.7.7.6