Skip to content

Commit

Permalink
Bug when TIM element length equals 2 (undefined m_bitmapControl) solved.
Browse files Browse the repository at this point in the history
  • Loading branch information
asljivo1 committed May 9, 2018
1 parent 2b5ed89 commit 160dcd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/wifi/model/ap-wifi-mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ ApWifiMac::SendOneBeacon (void)


m_PageIndex = m_pageslice.GetPageindex();
// m_TIM.SetPageIndex (m_PageIndex);
//m_TIM.SetPageIndex (m_PageIndex);
uint64_t numPagedStas (0);
for (auto it = m_supportPageSlicingList.begin(); it != m_supportPageSlicingList.end(); ++it){
if (m_stationManager->IsAssociated (it->first) && HasPacketsInQueueTo(it->first) )
Expand Down Expand Up @@ -1045,13 +1045,13 @@ ApWifiMac::SendOneBeacon (void)
m_blockoffset++; //actually block id
NS_ASSERT (m_blockoffset <= m_pageslice.GetBlockOffset () + m_pageslice.GetInformationFieldSize () * 8);
//block id cannot exceeds the max defined in the page slice element

m_TIM.SetPartialVBitmap (*m_encodedBlock);
if (m_encodedBlock)
delete m_encodedBlock;
}

}

beacon.SetTIM (m_TIM);
/* if (m_DTIMOffset == m_DTIMPeriod - 1)
{
Expand Down
10 changes: 8 additions & 2 deletions src/wifi/model/tim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,10 @@ TIM::SerializeInformationField (Buffer::Iterator start) const
if (m_BitmapControl || m_length != 0)
{
start.WriteU8 (m_BitmapControl);
NS_LOG_DEBUG ("Bitmap Control field is " << m_BitmapControl);
start.Write (m_partialVBitmap, m_length);
NS_LOG_DEBUG ("Bitmap Control field is " << (int)m_BitmapControl);
NS_LOG_DEBUG ("Length of Partial Virtual Bitmap is " << (int)m_length);
}
start.Write (m_partialVBitmap, m_length);
}

uint8_t
Expand All @@ -312,6 +313,11 @@ TIM::DeserializeInformationField (Buffer::Iterator start, uint8_t length)
m_partialVBitmap = m_partialVBitmap_arrary;

}
else
{
SetBitmapControl (0);
m_length = 0;
}
return length;
}

Expand Down

0 comments on commit 160dcd2

Please sign in to comment.