Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #218 from Takishipp/MSG2S4U
[simgrid.git] / src / kernel / routing / FullZone.cpp
index 9bae539..429f079 100644 (file)
@@ -14,7 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
 namespace simgrid {
 namespace kernel {
 namespace routing {
-FullZone::FullZone(NetZone* father, const char* name) : RoutedZone(father, name)
+FullZone::FullZone(NetZone* father, std::string name) : RoutedZone(father, name)
 {
 }
 
@@ -68,7 +68,7 @@ void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_
   if (e_route != nullptr) {
     res->gw_src = e_route->gw_src;
     res->gw_dst = e_route->gw_dst;
-    for (auto link : *e_route->link_list) {
+    for (auto const& link : *e_route->link_list) {
       res->link_list->push_back(link);
       if (lat)
         *lat += link->latency();
@@ -106,7 +106,7 @@ void FullZone::addRoute(sg_platf_route_cbarg_t route)
       route->gw_src   = route->gw_dst;
       route->gw_dst   = gw_tmp;
     }
-    if (route->gw_dst) // inter-zone route (to adapt the error message, if any)
+    if (route->gw_dst && route->gw_src) // inter-zone route (to adapt the error message, if any)
       xbt_assert(
           nullptr == TO_ROUTE_FULL(dst->id(), src->id()),
           "The route between %s@%s and %s@%s already exists. You should not declare the reverse path as symmetrical.",