]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/routing/FullZone.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #374 from adegomme/master
[simgrid.git] / src / kernel / routing / FullZone.cpp
index 1defdac90ac363540547bdbfe7aa4e033866f8f8..b7c0f33f203b8deed9b2365734127fb93e451ccc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -30,12 +30,12 @@ void FullZone::seal()
     routing_table_.resize(table_size * table_size, nullptr);
 
   /* Add the loopback if needed */
-  if (network_model_->loopback_ && hierarchy_ == RoutingMode::base) {
+  if (get_network_model()->loopback_ && hierarchy_ == RoutingMode::base) {
     for (unsigned int i = 0; i < table_size; i++) {
       RouteCreationArgs* route = TO_ROUTE_FULL(i, i);
       if (not route) {
         route = new RouteCreationArgs();
-        route->link_list.push_back(network_model_->loopback_);
+        route->link_list.push_back(get_network_model()->loopback_);
         TO_ROUTE_FULL(i, i) = route;
       }
     }
@@ -78,7 +78,7 @@ void FullZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoin
     routing_table_.resize(table_size * table_size, nullptr);
 
   /* Check that the route does not already exist */
-  if (gw_dst) // inter-zone route (to adapt the error message, if any)
+  if (gw_dst && gw_src) // inter-zone route (to adapt the error message, if any)
     xbt_assert(nullptr == TO_ROUTE_FULL(src->id(), dst->id()),
                "The route between %s@%s and %s@%s already exists (Rq: routes are symmetrical by default).",
                src->get_cname(), gw_src->get_cname(), dst->get_cname(), gw_dst->get_cname());