1
0
Fork 0

Fixes a bug where last_seen_seq was taken from unreliable packets

This commit is contained in:
Shawn Nock 2019-08-02 15:41:42 -04:00
parent 29c8a3d77b
commit 4e2003d8ea
1 changed files with 8 additions and 9 deletions

View File

@ -588,15 +588,14 @@ static void unproc_thread(void) {
goto next;
}
if (hdr.is_reliable) {
u8_t expected_seq = next_seq(h5.last_seen_seq_from_host);
if (hdr.is_reliable && hdr.seq != expected_seq) {
if (hdr.seq != expected_seq) {
LOG_ERR("Seq expected %u got %u. Drop packet", expected_seq, hdr.seq);
net_buf_unref(rx_buf);
goto next;
}
h5.last_seen_seq_from_host = hdr.seq;
if (hdr.is_reliable) {
/* Submit delayed work to ack the packet */
k_delayed_work_submit(&ack_work, H5_RX_ACK_TIMEOUT);
}