Fixes a bug where last_seen_seq was taken from unreliable packets
This commit is contained in:
parent
29c8a3d77b
commit
4e2003d8ea
17
src/main.c
17
src/main.c
|
@ -588,15 +588,14 @@ static void unproc_thread(void) {
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8_t expected_seq = next_seq(h5.last_seen_seq_from_host);
|
if (hdr.is_reliable) {
|
||||||
if (hdr.is_reliable && hdr.seq != expected_seq) {
|
u8_t expected_seq = next_seq(h5.last_seen_seq_from_host);
|
||||||
LOG_ERR("Seq expected %u got %u. Drop packet", expected_seq, hdr.seq);
|
if (hdr.seq != expected_seq) {
|
||||||
net_buf_unref(rx_buf);
|
LOG_ERR("Seq expected %u got %u. Drop packet", expected_seq, hdr.seq);
|
||||||
goto next;
|
net_buf_unref(rx_buf);
|
||||||
}
|
goto next;
|
||||||
h5.last_seen_seq_from_host = hdr.seq;
|
}
|
||||||
|
h5.last_seen_seq_from_host = hdr.seq;
|
||||||
if (hdr.is_reliable) {
|
|
||||||
/* Submit delayed work to ack the packet */
|
/* Submit delayed work to ack the packet */
|
||||||
k_delayed_work_submit(&ack_work, H5_RX_ACK_TIMEOUT);
|
k_delayed_work_submit(&ack_work, H5_RX_ACK_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue