Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203827
b: refs/heads/master
c: bfbacc1
h: refs/heads/master
i:
  203825: 2edbec1
  203823: 0f40ff3
v: v3
  • Loading branch information
João Paulo Rechi Vita authored and Marcel Holtmann committed Jul 21, 2010
1 parent 2bf7cd7 commit 6821738
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6e2b6722abaa3f6042357e11f465488b7c12f94c
refs/heads/master: bfbacc11550a785caf082f3ccfcd7ecf882e09a4
13 changes: 12 additions & 1 deletion trunk/net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3394,6 +3394,8 @@ static inline void l2cap_send_i_or_rr_or_rnr(struct sock *sk)
static int l2cap_add_to_srej_queue(struct sock *sk, struct sk_buff *skb, u8 tx_seq, u8 sar)
{
struct sk_buff *next_skb;
struct l2cap_pinfo *pi = l2cap_pi(sk);
int tx_seq_offset, next_tx_seq_offset;

bt_cb(skb)->tx_seq = tx_seq;
bt_cb(skb)->sar = sar;
Expand All @@ -3404,11 +3406,20 @@ static int l2cap_add_to_srej_queue(struct sock *sk, struct sk_buff *skb, u8 tx_s
return 0;
}

tx_seq_offset = (tx_seq - pi->buffer_seq) % 64;
if (tx_seq_offset < 0)
tx_seq_offset += 64;

do {
if (bt_cb(next_skb)->tx_seq == tx_seq)
return -EINVAL;

if (bt_cb(next_skb)->tx_seq > tx_seq) {
next_tx_seq_offset = (bt_cb(next_skb)->tx_seq -
pi->buffer_seq) % 64;
if (next_tx_seq_offset < 0)
next_tx_seq_offset += 64;

if (next_tx_seq_offset > tx_seq_offset) {
__skb_queue_before(SREJ_QUEUE(sk), next_skb, skb);
return 0;
}
Expand Down

0 comments on commit 6821738

Please sign in to comment.