From 8b5ec4b5ec7e6c5d07367ab1cfc170baa0a804e6 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 19 Mar 2015 20:04:25 -0700 Subject: [PATCH] bug 1982: mesh uses random variables before seeds can be set --- src/mesh/model/dot11s/hwmp-protocol.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mesh/model/dot11s/hwmp-protocol.cc b/src/mesh/model/dot11s/hwmp-protocol.cc index 39e7a9245..e8cd7870e 100644 --- a/src/mesh/model/dot11s/hwmp-protocol.cc +++ b/src/mesh/model/dot11s/hwmp-protocol.cc @@ -209,7 +209,8 @@ HwmpProtocol::DoInitialize () m_coefficient->SetAttribute ("Max", DoubleValue (m_randomStart.GetSeconds ())); if (m_isRoot) { - SetRoot (); + Time randomStart = Seconds (m_coefficient->GetValue ()); + m_proactivePreqTimer = Simulator::Schedule (randomStart, &HwmpProtocol::SendProactivePreq, this); } } @@ -1026,8 +1027,6 @@ HwmpProtocol::RetryPathDiscovery (Mac48Address dst, uint8_t numOfRetry) void HwmpProtocol::SetRoot () { - Time randomStart = Seconds (m_coefficient->GetValue ()); - m_proactivePreqTimer = Simulator::Schedule (randomStart, &HwmpProtocol::SendProactivePreq, this); NS_LOG_DEBUG ("ROOT IS: " << m_address); m_isRoot = true; }