From b8fb6a6f5a6ab3e0309a21eed7b88c9a690e88cb Mon Sep 17 00:00:00 2001 From: letiangit Date: Fri, 11 May 2018 13:03:18 +0200 Subject: [PATCH] Fix bug when numPagedStas is 0. --- scratch/test/s1g-test-tim-raw.cc | 3 +++ src/wifi/model/ap-wifi-mac.cc | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/scratch/test/s1g-test-tim-raw.cc b/scratch/test/s1g-test-tim-raw.cc index ff29db76a..ee975cde0 100644 --- a/scratch/test/s1g-test-tim-raw.cc +++ b/scratch/test/s1g-test-tim-raw.cc @@ -242,7 +242,10 @@ void checkRawAndTimConfiguration (void) // Number of TIM groups in a single page has to equal number of different RPS elements because // If #TIM > #RPS, the same RPS will be used in more than 1 TIM and that is wrong because // each TIM can accommodate different AIDs (same RPS means same stations in RAWs) + if(config.pageSliceCount) + { NS_ASSERT (config.pageSliceCount == config.rps.rpsset.size()); + } for (uint32_t j = 0; j < config.rps.rpsset.size(); j++) { uint32_t totalRawTime = 0; diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index cf18bdeb4..8c14ad870 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -991,6 +991,10 @@ ApWifiMac::SendOneBeacon (void) // Standard 10.47 page 325-326 } } + else if (m_pageslice.GetPageSliceCount () == 0 && numPagedStas == 0) + { + m_PageSliceNum = 0; + } uint8_t NumEncodedBlock; if (m_PageSliceNum != (m_pageslice.GetPageSliceCount() - 1) && m_PageSliceNum != 31) // convenient overflow if count==0