From 02c078b3c087d09ed4eb23f52a4100288385e4a7 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 30 Nov 2021 11:19:00 +0100 Subject: [PATCH] wifi: Delete PHY entities before changing PHY band --- src/wifi/model/wifi-phy.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index d034b29fe..bc3850b59 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -631,7 +631,7 @@ Ptr WifiPhy::GetPhyEntity (WifiModulationClass modulation) const { const auto it = m_phyEntities.find (modulation); - NS_ABORT_MSG_IF (it == m_phyEntities.end (), "Unsupported Wi-Fi modulation class"); + NS_ABORT_MSG_IF (it == m_phyEntities.end (), "Unsupported Wi-Fi modulation class " << modulation); return it->second; } @@ -891,6 +891,10 @@ WifiPhy::ConfigureStandard (WifiPhyStandard standard) return; } + // this function is called when changing PHY band, hence we have to delete + // the previous PHY entities + m_phyEntities.clear (); + switch (standard) { case WIFI_PHY_STANDARD_80211a: