|
|
| 494 |
} |
495 |
} |
| 495 |
else if (hdr->IsData ()) |
496 |
else if (hdr->IsData ()) |
| 496 |
{ |
497 |
{ |
|
|
498 |
if (!IsAssociated ()) |
| 499 |
{ |
| 500 |
NS_LOG_LOGIC ("Received data frame while not associated: ignore"); |
| 501 |
return; |
| 502 |
} |
| 503 |
if (!(hdr->IsFromDs () && !hdr->IsToDs ())) |
| 504 |
{ |
| 505 |
NS_LOG_LOGIC ("Received data frame not from the DS: ignore"); |
| 506 |
return; |
| 507 |
} |
| 508 |
if (hdr->GetAddr2 () != GetBssid ()) |
| 509 |
{ |
| 510 |
NS_LOG_LOGIC ("Received data frame not from the the BSS we are associated with: ignore"); |
| 511 |
return; |
| 512 |
} |
| 497 |
NS_LOG_LOGIC ("ForwardUp"); |
513 |
NS_LOG_LOGIC ("ForwardUp"); |
| 498 |
ForwardUp (packet, hdr->GetAddr2 (), hdr->GetAddr1 ()); |
514 |
ForwardUp (packet, hdr->GetAddr2 (), hdr->GetAddr1 ()); |
| 499 |
} |
515 |
} |
|
|
| 511 |
if (GetSsid ().IsBroadcast () || |
527 |
if (GetSsid ().IsBroadcast () || |
| 512 |
beacon.GetSsid ().IsEqual (GetSsid ())) |
528 |
beacon.GetSsid ().IsEqual (GetSsid ())) |
| 513 |
{ |
529 |
{ |
|
|
530 |
goodBeacon = true; |
| 531 |
} |
| 532 |
if (IsAssociated () && hdr->GetAddr3 () != GetBssid ()) |
| 533 |
{ |
| 534 |
goodBeacon = false; |
| 535 |
} |
| 536 |
if (goodBeacon) |
| 537 |
{ |
| 514 |
Time delay = MicroSeconds (beacon.GetBeaconIntervalUs () * m_maxMissedBeacons); |
538 |
Time delay = MicroSeconds (beacon.GetBeaconIntervalUs () * m_maxMissedBeacons); |
| 515 |
RestartBeaconWatchdog (delay); |
539 |
RestartBeaconWatchdog (delay); |
| 516 |
goodBeacon = true; |
|
|
| 517 |
} |
| 518 |
if (goodBeacon) |
| 519 |
{ |
| 520 |
SetBssid (hdr->GetAddr3 ()); |
540 |
SetBssid (hdr->GetAddr3 ()); |
| 521 |
} |
541 |
} |
| 522 |
if (goodBeacon && m_state == BEACON_MISSED) |
542 |
if (goodBeacon && m_state == BEACON_MISSED) |