diff --git a/src/vcm.c b/src/vcm.c index 35fd03e..886d421 100644 --- a/src/vcm.c +++ b/src/vcm.c @@ -416,7 +416,7 @@ static int intersection_detected(VCM_t* vcm, mc_neighbour_s* neighbour) { uint32_t intneigh[MC_MAX_NEIGHBOURS]; intneigh[0] = neighbour->station_id; int n_intneigh = 1; - for (int n = 0; n < coordination->neighbours_len; ++n) { + for (int n = 0; n < coordination->neighbours_len && n_intneigh < 15; ++n) { if (coordination->neighbours[n].station_id == neighbour->station_id) { continue; } diff --git a/src/vcm.h b/src/vcm.h index f801f6c..f7e7298 100644 --- a/src/vcm.h +++ b/src/vcm.h @@ -6,7 +6,7 @@ #include #include -#define MC_MAX_NEIGHBOURS 32 +#define MC_MAX_NEIGHBOURS 256 #define MC_RESOLUTION_TIMEOUT 1000 typedef struct { @@ -37,7 +37,7 @@ typedef struct coordination { void* mgmt_socket; mc_neighbour_s neighbours[MC_MAX_NEIGHBOURS]; - uint8_t neighbours_len; + uint16_t neighbours_len; struct { uint64_t id;