Hi,
here is the piece of code.
The statement, that I talk about is highlighted.
If I comment it out, the program gives segmentation fault.
Code:
if(sw_s != sw_d){
route_size = 0;
route = route_discovery(message_reqs->sw_producer_idx, message_reqs->sw_consumer_idx[c], &route_size);
printf("%d\n", route_size);
//~ printRoute(route, route_size);
l = 0;
do{
link_id = getLink(route[l], route[l+1]);
dir = getLoadDirection(link_id);
//~ printf("[check_message_fit_multidimensinally]************ load_limit: %lu, link: %d, dir: %d\n", load_limit, link_id, dir);
if (!check_switch_link(
dir,
&(sw_link_load[link_id]),
link_id,
(l+1),
&(current_ports_load[sw_s][port_s]),
message_reqs,
packet,
m_size_us,
load_limit))
{
return 0;
}
l++;
}while(l < (route_size-1) );
}
Thanks,