[PATCH 17/19] Bluetooth: Ignore I-frames with a duplicated txSeq

Gustavo F. Padovan
2010-03-23T19:48:44Z

L2CAP Enhanced Retransmission Mode shall ignore all I-frames with a
duplicated txSeq.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
---
net/bluetooth/l2cap.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 85f97b9..b431dc5 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -3413,6 +3413,13 @@ static inline int l2cap_data_channel_iframe(struct sock *sk, u16 rx_control, str
if (tx_seq == pi->expected_tx_seq)
goto expected;

+ /* Check for duplicated tx_seq. This actually
+ * subtracts 1 from expected_tx_seq */
+ if (tx_seq == (pi->expected_tx_seq + 63) % 64) {
+ kfree_skb(skb);
+ return 0;
+ }
+
if (pi->conn_state & L2CAP_CONN_SREJ_SENT) {
struct srej_list *first;

--
1.6.4.4