From 0d495740562f3dcac8b5debba63669ee33dc2283 Mon Sep 17 00:00:00 2001 From: Federico Maguolo Date: Tue, 26 Feb 2008 01:23:27 +0100 Subject: [PATCH] Sync event must be properly canceled upon tx during sync. --- src/devices/wifi/wifi-phy.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/devices/wifi/wifi-phy.cc b/src/devices/wifi/wifi-phy.cc index c5a5c3706..69b3956fd 100644 --- a/src/devices/wifi/wifi-phy.cc +++ b/src/devices/wifi/wifi-phy.cc @@ -356,10 +356,6 @@ WifiPhy::SendPacket (Ptr packet, WifiMode txMode, WifiPreamble pre */ NS_ASSERT (!IsStateTx ()); - if (IsStateSync ()) { - m_endSyncEvent.Cancel (); - } - Time txDuration = CalculateTxDuration (packet->GetSize (), txMode, preamble); NotifyTxStart (txDuration); SwitchToTx (txDuration); @@ -696,6 +692,8 @@ WifiPhy::SwitchToTx (Time txDuration) */ m_syncing = false; m_stateLogger (m_startSync, now - m_startSync, WifiPhy::SYNC); + m_endSyncEvent.Cancel (); + m_endSync = now; break; case WifiPhy::CCA_BUSY: { Time ccaStart = Max (m_endSync, m_endTx);