diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index 5fac9f0f6..dbfda502e 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -1131,10 +1131,6 @@ WifiPhy::SetOperatingChannel(const ChannelTuple& channelTuple) Time WifiPhy::GetDelayUntilChannelSwitch() { - m_powerRestricted = false; - m_channelAccessRequested = false; - m_currentEvent = nullptr; - m_currentPreambleEvents.clear(); if (!IsInitialized()) { // this is not channel switch, this is initialization @@ -1176,6 +1172,9 @@ WifiPhy::DoChannelSwitch() { NS_LOG_FUNCTION(this); + m_powerRestricted = false; + m_channelAccessRequested = false; + // Update unspecified parameters with default values { auto& [number, width, band, primary20] = m_channelSettings;