Commit 02f1b641 authored by Mat Martineau's avatar Mat Martineau Committed by Gustavo F. Padovan

Bluetooth: Check earlier for L2CAP ERTM frames to drop

Even when the received tx_seq is expected, the frame still needs to be
dropped if the TX window is exceeded or the receiver is in the local
busy state.
Signed-off-by: default avatarMat Martineau <mathewm@codeaurora.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent f8c1fbdb
...@@ -3522,9 +3522,6 @@ static inline int l2cap_data_channel_iframe(struct l2cap_chan *chan, u16 rx_cont ...@@ -3522,9 +3522,6 @@ static inline int l2cap_data_channel_iframe(struct l2cap_chan *chan, u16 rx_cont
chan->expected_ack_seq = req_seq; chan->expected_ack_seq = req_seq;
l2cap_drop_acked_frames(chan); l2cap_drop_acked_frames(chan);
if (tx_seq == chan->expected_tx_seq)
goto expected;
tx_seq_offset = (tx_seq - chan->buffer_seq) % 64; tx_seq_offset = (tx_seq - chan->buffer_seq) % 64;
if (tx_seq_offset < 0) if (tx_seq_offset < 0)
tx_seq_offset += 64; tx_seq_offset += 64;
...@@ -3538,6 +3535,9 @@ static inline int l2cap_data_channel_iframe(struct l2cap_chan *chan, u16 rx_cont ...@@ -3538,6 +3535,9 @@ static inline int l2cap_data_channel_iframe(struct l2cap_chan *chan, u16 rx_cont
if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state))
goto drop; goto drop;
if (tx_seq == chan->expected_tx_seq)
goto expected;
if (test_bit(CONN_SREJ_SENT, &chan->conn_state)) { if (test_bit(CONN_SREJ_SENT, &chan->conn_state)) {
struct srej_list *first; struct srej_list *first;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment