aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/serialqueue.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-09-07 14:44:55 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-09-08 11:50:21 -0400
commit91b9634198df0163f71d3f9c1c15f2f79eb42155 (patch)
treeab05da99ee6d614abb4595bbf328bc91dcda7961 /klippy/serialqueue.c
parent7d17002b33f9f5da78bfde049331e125b426a4f9 (diff)
downloadkutter-91b9634198df0163f71d3f9c1c15f2f79eb42155.tar.gz
kutter-91b9634198df0163f71d3f9c1c15f2f79eb42155.tar.xz
kutter-91b9634198df0163f71d3f9c1c15f2f79eb42155.zip
serialqueue: Fix off-by-one error in retransmit sequence number tracking
Commit 4655a6bf allowed naks to be honored if receive_seq was greater than the last retransmitted sequence. However, receive_seq is the receiver's next sequence number, so a nak should only be processed if it is one greater than that. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/serialqueue.c')
-rw-r--r--klippy/serialqueue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/serialqueue.c b/klippy/serialqueue.c
index 6ad1b916..7247022a 100644
--- a/klippy/serialqueue.c
+++ b/klippy/serialqueue.c
@@ -609,9 +609,9 @@ retransmit_event(struct serialqueue *sq, double eventtime)
sq->rto *= 2.0;
if (sq->rto > MAX_RTO)
sq->rto = MAX_RTO;
- sq->ignore_nak_seq = sq->send_seq - 1;
+ sq->ignore_nak_seq = sq->send_seq;
}
- sq->retransmit_seq = sq->send_seq - 1;
+ sq->retransmit_seq = sq->send_seq;
sq->rtt_sample_seq = 0;
sq->idle_time = eventtime + buflen * sq->baud_adjust;
double waketime = eventtime + first_buflen * sq->baud_adjust + sq->rto;