From 1530209b2297c8fb86315b84ff1addd503a3d9fa Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 20 Mar 2019 08:51:40 +0100 Subject: [PATCH] Fix another bug of comparison --- src/algo_rr.c | 1 + src/utils.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/algo_rr.c b/src/algo_rr.c index f2ef452..058661a 100644 --- a/src/algo_rr.c +++ b/src/algo_rr.c @@ -130,6 +130,7 @@ void rr_pkt_register(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, } // 3. If packet arrived too early, we register a timer + printf("%d < %d = %d\n", rr->recv_id, bp->ip.ap.str.id - 1, ring_lt(rr->recv_id, bp->ip.ap.str.id - 1)); if (ring_lt(rr->recv_id, bp->ip.ap.str.id - 1)) { int64_t timeout = rr->mjit - (int64_t) bp->ip.ap.str.deltat; //printf("%ld - %ld = %ld\n", rr->mjit, (int64_t) bp->ip.ap.str.deltat, timeout); diff --git a/src/utils.c b/src/utils.c index ad49cf9..287d820 100644 --- a/src/utils.c +++ b/src/utils.c @@ -74,9 +74,9 @@ int ring_gt(uint16_t v1, uint16_t v2) { } int ring_le(uint16_t v1, uint16_t v2) { - return ring_gt(v2, v1); + return ring_ge(v2, v1); } int ring_lt(uint16_t v1, uint16_t v2) { - return ring_ge(v2, v1); + return ring_gt(v2, v1); }