From 03e241866fbcf95ebb910ec07c048a9b10376aeb Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Mon, 11 Sep 2023 15:54:06 +0200 Subject: [PATCH] wifi: No PHY may be operating on an EMLSR link when watchdog expires --- src/wifi/model/sta-wifi-mac.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index cfab2983b..43d726736 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -846,13 +846,14 @@ StaWifiMac::MissedBeacons() return; } NS_LOG_DEBUG("beacon missed"); - // We need to switch to the UNASSOCIATED state. However, if we are receiving - // a frame, wait until the RX is completed (otherwise, crashes may occur if - // we are receiving a MU frame because its reception requires the STA-ID) + // We need to switch to the UNASSOCIATED state. However, if we are receiving a frame, wait + // until the RX is completed (otherwise, crashes may occur if we are receiving a MU frame + // because its reception requires the STA-ID). We need to check that a PHY is operating on + // the given link, because this may (temporarily) not be the case for EMLSR clients. Time delay = Seconds(0); for (const auto& [id, link] : GetLinks()) { - if (link->phy->IsStateRx()) + if (link->phy && link->phy->IsStateRx()) { delay = std::max(delay, link->phy->GetDelayUntilIdle()); }