From fe77c7349270c39f2ed657268f69adcbdb3e1a63 Mon Sep 17 00:00:00 2001 From: emanuel Date: Thu, 2 Feb 2023 13:09:18 +0000 Subject: [PATCH] Fix if VCM.req is for self --- src/vcm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/vcm.c b/src/vcm.c index 7c1a42b..fdf7ed9 100644 --- a/src/vcm.c +++ b/src/vcm.c @@ -384,11 +384,6 @@ static int vcm_check_handle_request(VCM_t* vcm, mc_neighbour_s* neighbour) { uint64_t now = itss_time_get(); - if (coordination->session.own_req && now < coordination->session.ts + MC_RESOLUTION_TIMEOUT) { /* in maneuver */ - log_debug("[vc] rejecting VCM from %d - currently in maneuver", vcm->header.stationID); - vcm_reject(vcm, neighbour); - return 1; - } // Is request for me? CoordinationRequest_t* request = &vcm->vcm.maneuverContainer.choice.vehicle.negotiation->choice.request; @@ -410,6 +405,12 @@ static int vcm_check_handle_request(VCM_t* vcm, mc_neighbour_s* neighbour) { return 0; } + if (coordination->session.own_req && now < coordination->session.ts + MC_RESOLUTION_TIMEOUT) { /* in maneuver */ + log_debug("[vc] rejecting VCM from %d - currently in maneuver", vcm->header.stationID); + vcm_reject(vcm, neighbour); + return 1; + } + const ssize_t buf_len = 512; uint8_t buf1[buf_len], buf2[buf_len];