X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1f606358fff6ef994cd58570e7c77ee6259d6a4e..97fa57103ccd60e8fc4c04ea6591904a7600a679:/src/surf/AsImpl.cpp diff --git a/src/surf/AsImpl.cpp b/src/surf/AsImpl.cpp index 5fb43f4f38..3a9f80e595 100644 --- a/src/surf/AsImpl.cpp +++ b/src/surf/AsImpl.cpp @@ -192,14 +192,15 @@ namespace simgrid { /* If src and dst are in the same AS, life is good */ if (src_ancestor == dst_ancestor) { /* SURF_ROUTING_BASE */ + route.link_list = links; common_ancestor->getRouteAndLatency(src, dst, &route, latency); - for (surf::Link *link : route.link_list) - links->push_back(link); return; } /* Not in the same AS, no bypass. We'll have to find our path between the ASes recursively*/ + route.link_list = new std::vector(); + common_ancestor->getRouteAndLatency(src_ancestor->netcard_, dst_ancestor->netcard_, &route, latency); xbt_assert((route.gw_src != NULL) && (route.gw_dst != NULL), "bad gateways for route from \"%s\" to \"%s\"", src->name(), dst->name()); @@ -207,12 +208,14 @@ namespace simgrid { /* If source gateway is not our source, we have to recursively find our way up to this point */ if (src != route.gw_src) getRouteRecursive(src, route.gw_src, links, latency); - for (auto link: route.link_list) + for (auto link: *route.link_list) links->push_back(link); /* If dest gateway is not our destination, we have to recursively find our way from this point */ if (route.gw_dst != dst) getRouteRecursive(route.gw_dst, dst, links, latency); + } + } };