From b4cdf340114bf4390d30b9ca94dd3182d341b351 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 13 Jan 2021 17:39:17 +0100 Subject: [PATCH] Fix a second bug --- src/meas_lat.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/meas_lat.c b/src/meas_lat.c index 4b2ab51..96b50f7 100644 --- a/src/meas_lat.c +++ b/src/meas_lat.c @@ -101,8 +101,8 @@ void measlat_stop( printf("All measurements done\n"); evt_core_rm_fd(ctx, timer_fd); + evt_core_rm_fd(ctx, net_fd); if (mctx->role == MEASLAT_CLIENT) { - evt_core_rm_fd(ctx, net_fd); exit(EXIT_SUCCESS); } } @@ -156,8 +156,10 @@ int on_receive_measure_packet(struct evt_core_ctx* ctx, struct evt_core_fdinfo* } // 5. Check if our measurements are done - if (ms->mp_in->counter >= mctx->mp.max_measure && ms->mp_out->counter >= mctx->mp.max_measure) + if (ms->mp_in->counter >= mctx->mp.max_measure && ms->mp_out->counter >= mctx->mp.max_measure) { measlat_stop(ctx, mctx, ms, fdinfo->fd, assoc_timer->fd); + return 1; + } return 0; } @@ -222,8 +224,10 @@ int on_timer(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { exit(EXIT_FAILURE); } - if (ms->mp_in->counter >= mctx->mp.max_measure && ms->mp_out->counter >= mctx->mp.max_measure) + if (ms->mp_in->counter >= mctx->mp.max_measure && ms->mp_out->counter >= mctx->mp.max_measure) { measlat_stop(ctx, mctx, ms, ms->fd, fdinfo->fd); + return 1; + } return 0; }