Fix if VCM.req is for self

This commit is contained in:
emanuel 2023-02-02 13:09:18 +00:00
parent 7308232b61
commit fe77c73492
1 changed files with 6 additions and 5 deletions

View File

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