- if (strcmp(e_route_cnt->dst_gateway, dst)) {
- double latency_dst;
- xbt_dynar_t route_dst;
-
- _get_route_latency(e_route_cnt->dst_gateway, dst,
- (route ? &route_dst : NULL),
- (latency ? &latency_dst : NULL));
- if (route) {
- xbt_assert(route_dst, "no route between \"%s\" and \"%s\"",
- e_route_cnt->dst_gateway, dst);
- xbt_dynar_foreach(route_dst, cpt, link) {
- xbt_dynar_push(*route, &link);
- }
- xbt_dynar_free(&route_dst);
- }
- if (latency) {
- xbt_assert(latency_dst >= 0.0,
- "latency error on route between \"%s\" and \"%s\"",
- e_route_cnt->dst_gateway, dst);
- *latency += latency_dst;
- }
- }
+ /* Not in the same AS, no bypass. We'll have to find our path between the ASes recursively*/
+
+ route.link_list = xbt_dynar_new(global_routing->size_of_link, NULL);
+ common_father->get_route_and_latency(common_father, src_father->name, dst_father->name, &route,latency);
+
+ xbt_assert((route.src_gateway != NULL) && (route.dst_gateway != NULL),
+ "bad gateways for route from \"%s\" to \"%s\"", src, dst);
+
+ *links = xbt_dynar_new(global_routing->size_of_link, NULL);
+
+ char*src_gateway = route.src_gateway;
+ char*dst_gateway = route.dst_gateway;
+
+ /* If source gateway is not our source, we have to recursively find our way up to this point */
+ if (strcmp(src, src_gateway))
+ _get_route_and_latency(src, src_gateway, links, latency);