Fix another bug of comparison

This commit is contained in:
Quentin Dufour 2019-03-20 08:51:40 +01:00
parent cd7f12aee0
commit 1530209b22
2 changed files with 3 additions and 2 deletions

View file

@ -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);

View file

@ -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);
}