Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
1.1 --- a/src/devices/wifi/dcf-manager-test.cc Thu Jul 16 11:19:43 2009 +0200
1.2 +++ b/src/devices/wifi/dcf-manager-test.cc Thu Jul 16 13:51:12 2009 +0400
1.3 @@ -379,6 +379,21 @@
1.4 AddAccessRequest (30, 2, 70, 0);
1.5 ExpectCollision (30, 0, 0); // backoff: 0 slots
1.6 EndTest ();
1.7 + // Test shows when two frames are received without interval between
1.8 + // them:
1.9 + // 20 60 100 106 110 112
1.10 + // | rx | rx |sifs | aifsn | tx |
1.11 + // |
1.12 + // 30 request access. backoff slots: 0
1.13 +
1.14 + StartTest (4, 6 , 10);
1.15 + AddDcfState (1);
1.16 + AddRxOkEvt (20, 40);
1.17 + AddRxOkEvt (60, 40);
1.18 + AddAccessRequest (30, 2, 110, 0);
1.19 + ExpectCollision (30, 0, 0); // backoff: 0 slots
1.20 + EndTest ();
1.21 +
1.22
1.23 // The test below is subject to some discussion because I am
1.24 // not sure I understand the intent of the spec here.
2.1 --- a/src/devices/wifi/dcf-manager.cc Thu Jul 16 11:19:43 2009 +0200
2.2 +++ b/src/devices/wifi/dcf-manager.cc Thu Jul 16 13:51:12 2009 +0400
2.3 @@ -433,7 +433,7 @@
2.4 DcfManager::GetAccessGrantStart (void) const
2.5 {
2.6 Time rxAccessStart;
2.7 - if (m_lastRxEnd >= m_lastRxStart)
2.8 + if (!m_rxing)
2.9 {
2.10 rxAccessStart = m_lastRxEnd;
2.11 if (!m_lastRxReceivedOk)