summaryrefslogtreecommitdiff
path: root/src/lib/rxmwheel.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-10-09 10:03:34 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-10-09 13:04:09 +0200
commit1d4501adf6da8f55dea85c0389b911b24e722620 (patch)
tree80dde95b29d9ef723869fa8f57fde37775781be0 /src/lib/rxmwheel.c
parent664b815345553592b840e6be89384a91f9ee110b (diff)
downloadouroboros-1d4501adf6da8f55dea85c0389b911b24e722620.tar.gz
ouroboros-1d4501adf6da8f55dea85c0389b911b24e722620.zip
lib: Fix initial automated repeat-request
This fixes rudimentary automated repeat-request ARQ to correctly configure the both connection records and use the receiver seqno. The rto variable is moved out of the connection record. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src/lib/rxmwheel.c')
-rw-r--r--src/lib/rxmwheel.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/rxmwheel.c b/src/lib/rxmwheel.c
index 697c6a48..69151801 100644
--- a/src/lib/rxmwheel.c
+++ b/src/lib/rxmwheel.c
@@ -201,7 +201,7 @@ static int rxmwheel_move(void)
r->tail = shm_du_buff_tail(sdb);
r->sdb = sdb;
- newtime = ts_to_ms(now) + (snd_cr->rto << ++r->mul);
+ newtime = ts_to_ms(now) + (f->frcti->rto << ++r->mul);
rslot = (newtime >> RXMQ_R) & (RXMQ_SLOTS - 1);
list_add_tail(&r->next, &rw.wheel[rslot]);
@@ -239,8 +239,7 @@ static int rxmwheel_add(struct frcti * frcti,
r->tail = shm_du_buff_tail(sdb);
r->frcti = frcti;
- slot = ((r->t0 + frcti->snd_cr.rto) >> RXMQ_R)
- & (RXMQ_SLOTS - 1);
+ slot = ((r->t0 + frcti->rto) >> RXMQ_R) & (RXMQ_SLOTS - 1);
list_add_tail(&r->next, &rw.wheel[slot]);