if(s->connMan->get_connections_to_group(intermediate_group_id).size()==0){//if we don't have a connection to the intermediate group, we have to reroute or reselect
if(s->connMan->get_connections_to_group(intermediate_group_id).size()==0){//if we don't have a connection to the intermediate group, we have to reroute or reselect
}//else we already have a connection to the intermediate spine
if(s->params->source_group_rerouting==0&&isRoutingAdaptive(routing)){//if we cannot reroute within our source group, we have to pick a new intermediate router
dfp_reselect_intermediate_router(s,bf,msg,lp,origin_group_id,fdest_group_id);//alters msg->intm_rtr_id to be more appropriate
}
elseif(intm_router_type==LEAF){//we want a connection to the intermediate group