Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6337c77 authored by Gustavo Padovan's avatar Gustavo Padovan Committed by Marcel Holtmann
Browse files

Bluetooth: Fix drop of packets with invalid req_seq/tx_seq



We shall not use an unsigned var since we are expecting negatives value
there. Using unsigned causes ERTM connection to close due to invalid
ReqSeq numbers.

Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 0b31c85c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3796,7 +3796,7 @@ static inline int l2cap_data_channel_iframe(struct sock *sk, u16 rx_control, str
	u8 tx_seq = __get_txseq(rx_control);
	u8 req_seq = __get_reqseq(rx_control);
	u8 sar = rx_control >> L2CAP_CTRL_SAR_SHIFT;
	u8 tx_seq_offset, expected_tx_seq_offset;
	int tx_seq_offset, expected_tx_seq_offset;
	int num_to_ack = (pi->tx_win/6) + 1;
	int err = 0;

@@ -4081,7 +4081,8 @@ 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, req_seq, next_tx_seq_offset, req_seq_offset;
	u8 tx_seq, req_seq;
	int next_tx_seq_offset, req_seq_offset;

	sk = l2cap_get_chan_by_scid(&conn->chan_list, cid);
	if (!sk) {