From d5e5174e32531cd3a94f8a737cf4cabd5aca9685 Mon Sep 17 00:00:00 2001 From: Bruno Donassolo Date: Wed, 5 Jan 2022 15:32:04 +0100 Subject: [PATCH] Fix MR74, workaround for s4u-network-ns3-wifi Fix error in NS3 introduced at merge request #74. Rebuild the routing table at each netzone seal. In theory, this could be done once at the seal of the platform. However, our current platform_created signal is called when the XML parsing has finished. The seal occurs only later at the Engine::run. --- src/surf/network_ns3.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 29435110a8..900518a179 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -170,7 +171,6 @@ static void zoneCreation_cb(simgrid::s4u::NetZone const& zone) mobility.SetPositionAllocator(positionAllocS); mobility.Install(nodes); - ns3::Ipv4AddressHelper address; std::string addr = simgrid::xbt::string_printf("%d.%d.0.0", number_of_networks, number_of_links); address.SetBase(addr.c_str(), "255.255.0.0"); @@ -187,6 +187,9 @@ static void zoneCreation_cb(simgrid::s4u::NetZone const& zone) } else { number_of_links++; } + /* in theory we can compute the routing table only only once at the platform seal + * however put it here since or platform_created signal is called before the seal right now */ + ns3::Ipv4GlobalRoutingHelper::RecomputeRoutingTables(); } static void clusterCreation_cb(simgrid::kernel::routing::ClusterCreationArgs const& cluster) -- 2.20.1