From 47ebdfbbf04cba1d7639fd003884df021ba25c22 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Thu, 30 Nov 2023 18:01:59 +0100 Subject: [PATCH] wifi: Do not start access on a link on which no PHY is operating --- src/wifi/model/txop.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wifi/model/txop.cc b/src/wifi/model/txop.cc index 653e922ec..cfbfa426a 100644 --- a/src/wifi/model/txop.cc +++ b/src/wifi/model/txop.cc @@ -25,6 +25,7 @@ #include "wifi-mac-queue.h" #include "wifi-mac-trailer.h" #include "wifi-mac.h" +#include "wifi-phy.h" #include "ns3/attribute-container.h" #include "ns3/log.h" @@ -602,6 +603,12 @@ Txop::StartAccessAfterEvent(uint8_t linkId, bool hadFramesToTransmit, bool check { NS_LOG_FUNCTION(this << linkId << hadFramesToTransmit << checkMediumBusy); + if (!m_mac->GetWifiPhy(linkId)) + { + NS_LOG_DEBUG("No PHY operating on link " << +linkId); + return; + } + if (GetLink(linkId).access != NOT_REQUESTED) { NS_LOG_DEBUG("Channel access already requested or granted on link " << +linkId);