- if(TO_FLOYD_LINK(src_net_elm->id(), dst_net_elm->id()))
- {
-
- char * link_name;
- unsigned int cpt;
- xbt_dynar_t link_route_to_test = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
- xbt_dynar_foreach(route->link_list,cpt,link_name)
- {
- void *link = Link::byName(link_name);
- xbt_assert(link,"Link : '%s' doesn't exists.",link_name);
- xbt_dynar_push(link_route_to_test,&link);
- }
- xbt_assert(!xbt_dynar_compare(
- TO_FLOYD_LINK(src_net_elm->id(), dst_net_elm->id())->link_list,
- link_route_to_test,
- (int_f_cpvoid_cpvoid_t) floyd_pointer_resource_cmp),
- "The route between \"%s\" and \"%s\" already exists", src,dst);
- }
+ /* Check that the route does not already exist */
+ if (route->gw_dst) // AS route (to adapt the error message, if any)
+ xbt_assert(nullptr == TO_FLOYD_LINK(src->id(), dst->id()),
+ "The route between %s@%s and %s@%s already exists (Rq: routes are symmetrical by default).",
+ src->name(),route->gw_src->name(),dst->name(),route->gw_dst->name());