diff options
author | Mat Martineau <mathewm@codeaurora.org> | 2011-06-29 17:35:19 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-07-01 15:13:20 -0400 |
commit | 02f1b641060486df8eecd66b060ae6551f398593 (patch) | |
tree | 07518b00fdfc12714f6684753ff9102144d1e515 /net/bluetooth | |
parent | f8c1fbdb767f7487983b369a0b07ddc82b29f709 (diff) |
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: Mat Martineau <mathewm@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 27b2cd124f00..bd5d9926bf4f 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -3522,9 +3522,6 @@ static inline int l2cap_data_channel_iframe(struct l2cap_chan *chan, u16 rx_cont | |||
3522 | chan->expected_ack_seq = req_seq; | 3522 | chan->expected_ack_seq = req_seq; |
3523 | l2cap_drop_acked_frames(chan); | 3523 | l2cap_drop_acked_frames(chan); |
3524 | 3524 | ||
3525 | if (tx_seq == chan->expected_tx_seq) | ||
3526 | goto expected; | ||
3527 | |||
3528 | tx_seq_offset = (tx_seq - chan->buffer_seq) % 64; | 3525 | tx_seq_offset = (tx_seq - chan->buffer_seq) % 64; |
3529 | if (tx_seq_offset < 0) | 3526 | if (tx_seq_offset < 0) |
3530 | tx_seq_offset += 64; | 3527 | tx_seq_offset += 64; |
@@ -3538,6 +3535,9 @@ static inline int l2cap_data_channel_iframe(struct l2cap_chan *chan, u16 rx_cont | |||
3538 | if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) | 3535 | if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) |
3539 | goto drop; | 3536 | goto drop; |
3540 | 3537 | ||
3538 | if (tx_seq == chan->expected_tx_seq) | ||
3539 | goto expected; | ||
3540 | |||
3541 | if (test_bit(CONN_SREJ_SENT, &chan->conn_state)) { | 3541 | if (test_bit(CONN_SREJ_SENT, &chan->conn_state)) { |
3542 | struct srej_list *first; | 3542 | struct srej_list *first; |
3543 | 3543 | ||