From d1a4ff3a99034c094dc9e75edb816cd6dd2179f6 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Fri, 26 Jun 2009 12:57:29 +0200 Subject: [PATCH] bug 605: Nqsta MAC should ignore beacons SSIDs while waiting for association response --- src/devices/wifi/nqsta-wifi-mac.cc | 12 +++++++++--- src/devices/wifi/nqsta-wifi-mac.h | 3 ++- src/devices/wifi/qsta-wifi-mac.cc | 12 +++++++++--- src/devices/wifi/qsta-wifi-mac.h | 3 ++- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/devices/wifi/nqsta-wifi-mac.cc b/src/devices/wifi/nqsta-wifi-mac.cc index 0fedd0e45..4a979500b 100644 --- a/src/devices/wifi/nqsta-wifi-mac.cc +++ b/src/devices/wifi/nqsta-wifi-mac.cc @@ -453,9 +453,15 @@ NqstaWifiMac::RestartBeaconWatchdog (Time delay) } } bool -NqstaWifiMac::IsAssociated (void) +NqstaWifiMac::IsAssociated (void) const { - return (m_state == ASSOCIATED)?true:false; + return m_state == ASSOCIATED; +} + +bool +NqstaWifiMac::IsWaitAssocResp (void) const +{ + return m_state == WAIT_ASSOC_RESP; } void @@ -553,7 +559,7 @@ NqstaWifiMac::Receive (Ptr packet, WifiMacHeader const *hdr) { goodBeacon = true; } - if (IsAssociated () && hdr->GetAddr3 () != GetBssid ()) + if ((IsWaitAssocResp () || IsAssociated ()) && hdr->GetAddr3 () != GetBssid ()) { goodBeacon = false; } diff --git a/src/devices/wifi/nqsta-wifi-mac.h b/src/devices/wifi/nqsta-wifi-mac.h index 4675db4f9..def5fc23d 100644 --- a/src/devices/wifi/nqsta-wifi-mac.h +++ b/src/devices/wifi/nqsta-wifi-mac.h @@ -130,7 +130,8 @@ private: void TryToEnsureAssociated (void); void AssocRequestTimeout (void); void ProbeRequestTimeout (void); - bool IsAssociated (void); + bool IsAssociated (void) const; + bool IsWaitAssocResp (void) const; void MissedBeacons (void); void RestartBeaconWatchdog (Time delay); SupportedRates GetSupportedRates (void) const; diff --git a/src/devices/wifi/qsta-wifi-mac.cc b/src/devices/wifi/qsta-wifi-mac.cc index cea46ba71..cdb12ba27 100644 --- a/src/devices/wifi/qsta-wifi-mac.cc +++ b/src/devices/wifi/qsta-wifi-mac.cc @@ -484,9 +484,15 @@ QstaWifiMac::RestartBeaconWatchdog (Time delay) } bool -QstaWifiMac::IsAssociated () +QstaWifiMac::IsAssociated (void) const { - return (m_state == ASSOCIATED)?true:false; + return m_state == ASSOCIATED; +} + +bool +QstaWifiMac::IsWaitAssocResp (void) const +{ + return m_state == WAIT_ASSOC_RESP; } void @@ -593,7 +599,7 @@ QstaWifiMac::Receive (Ptr packet, const WifiMacHeader *hdr) { goodBeacon = true; } - if (IsAssociated () && hdr->GetAddr3 () != GetBssid ()) + if ((IsWaitAssocResp () || IsAssociated ()) && hdr->GetAddr3 () != GetBssid ()) { goodBeacon = false; } diff --git a/src/devices/wifi/qsta-wifi-mac.h b/src/devices/wifi/qsta-wifi-mac.h index a6feba351..1d80e1383 100644 --- a/src/devices/wifi/qsta-wifi-mac.h +++ b/src/devices/wifi/qsta-wifi-mac.h @@ -101,7 +101,8 @@ private: void SendAssociationRequest (void); void SendProbeRequest (void); void TryToEnsureAssociated (void); - bool IsAssociated (void); + bool IsAssociated (void) const; + bool IsWaitAssocResp (void) const; virtual void DoDispose (void); /**