Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194857
b: refs/heads/master
c: 01760bd
h: refs/heads/master
i:
  194855: f78eef5
v: v3
  • Loading branch information
João Paulo Rechi Vita authored and Marcel Holtmann committed May 10, 2010
1 parent 0b1927a commit f971e1c
Show file tree
Hide file tree
Showing 2 changed files with 18 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: afefdbc4cf3b9d409d07e1e5264e7ff88bc48711
refs/heads/master: 01760bdde9a92413b7fff928d08e19352bf09d82
18 changes: 17 additions & 1 deletion trunk/net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3772,7 +3772,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
struct sock *sk;
struct l2cap_pinfo *pi;
u16 control, len;
u8 tx_seq;
u8 tx_seq, req_seq, next_tx_seq_offset, req_seq_offset;

sk = l2cap_get_chan_by_scid(&conn->chan_list, cid);
if (!sk) {
Expand Down Expand Up @@ -3823,6 +3823,22 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
if (l2cap_check_fcs(pi, skb))
goto drop;

req_seq = __get_reqseq(control);
req_seq_offset = (req_seq - pi->expected_ack_seq) % 64;
if (req_seq_offset < 0)
req_seq_offset += 64;

next_tx_seq_offset =
(pi->next_tx_seq - pi->expected_ack_seq) % 64;
if (next_tx_seq_offset < 0)
next_tx_seq_offset += 64;

/* check for invalid req-seq */
if (req_seq_offset > next_tx_seq_offset) {
l2cap_send_disconn_req(pi->conn, sk);
goto drop;
}

if (__is_iframe(control)) {
if (len < 4)
goto drop;
Expand Down

0 comments on commit f971e1c

Please sign in to comment.