start a backoff only if no backoff is started

This commit is contained in:
Mathieu Lacage
2007-11-15 13:37:51 +01:00
parent b15597dbe7
commit b52be989ed

View File

@@ -65,6 +65,7 @@ void
DcfState::StartBackoffNow (uint32_t nSlots)
{
NS_ASSERT (m_backoffSlots == 0);
MY_DEBUG ("start backoff="<<nSlots<<" slots");
m_backoffSlots = nSlots;
m_backoffStart = Simulator::Now ();
}
@@ -196,7 +197,7 @@ DcfManager::RequestAccess (DcfState *state)
* backoff running for this DcfState, start a new backoff
* if needed.
*/
if (GetBackoffEndFor (state) <= Simulator::Now () &&
if (state->GetBackoffSlots () == 0 &&
IsBusy ())
{
MY_DEBUG ("medium is busy: collision");