Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
src and dst can be in host_lib or as_router_lib.
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 24 Mar 2011 10:36:24 +0000 (10:36 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 24 Mar 2011 10:36:24 +0000 (10:36 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9843 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/surf_routing.c

index fd3d3e1..2bc91e5 100644 (file)
@@ -2992,14 +2992,17 @@ static route_extended_t generic_get_bypassroute(routing_component_t rc,
   routing_component_t *current_dst = NULL;
 
   /* (1) find the as where the src and dst are located */
-  src_as = ((network_element_info_t)
-            xbt_lib_get_or_null(host_lib, src, ROUTING_HOST_LEVEL))->rc_component;
-  dst_as = ((network_element_info_t)
-            xbt_lib_get_or_null(host_lib, dst, ROUTING_HOST_LEVEL))->rc_component;
-  xbt_assert2(src_as
-              && dst_as,
-              "Ask for route \"from\"(%s) or \"to\"(%s) no found", src,
-              dst);
+  void * src_data = xbt_lib_get_or_null(host_lib,src, ROUTING_HOST_LEVEL);
+  void * dst_data = xbt_lib_get_or_null(host_lib,dst, ROUTING_HOST_LEVEL);
+  if(!src_data) src_data = xbt_lib_get_or_null(as_router_lib,src, ROUTING_ASR_LEVEL);
+  if(!dst_data) dst_data = xbt_lib_get_or_null(as_router_lib,dst, ROUTING_ASR_LEVEL);
+
+  if(src_data == NULL || dst_data == NULL)
+         xbt_die("Ask for route \"from\"(%s) or \"to\"(%s) no found at AS \"%s\"",
+                    src, dst, rc->name);
+
+  src_as = ((network_element_info_t)src_data)->rc_component;
+  dst_as = ((network_element_info_t)dst_data)->rc_component;
 
   /* (2) find the path to the root routing component */
   path_src = xbt_dynar_new(sizeof(routing_component_t), NULL);