bug 605: Nqsta MAC should ignore beacons SSIDs while waiting for association response
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Fri, 26 Jun 2009 12:57:29 +0200
changeset 4609 6ec902d6af68
parent 4608 13f3a1412f28
child 4610 48dddd9d79ee
bug 605: Nqsta MAC should ignore beacons SSIDs while waiting for association response
src/devices/wifi/nqsta-wifi-mac.cc
src/devices/wifi/nqsta-wifi-mac.h
src/devices/wifi/qsta-wifi-mac.cc
src/devices/wifi/qsta-wifi-mac.h
--- a/src/devices/wifi/nqsta-wifi-mac.cc	Fri Jun 26 10:56:59 2009 +0200
+++ b/src/devices/wifi/nqsta-wifi-mac.cc	Fri Jun 26 12:57:29 2009 +0200
@@ -453,9 +453,15 @@
     }
 }
 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 @@
         {
           goodBeacon = true;
         }
-      if (IsAssociated () && hdr->GetAddr3 () != GetBssid ())
+      if ((IsWaitAssocResp () || IsAssociated ()) && hdr->GetAddr3 () != GetBssid ())
         {
           goodBeacon = false;
         }
--- a/src/devices/wifi/nqsta-wifi-mac.h	Fri Jun 26 10:56:59 2009 +0200
+++ b/src/devices/wifi/nqsta-wifi-mac.h	Fri Jun 26 12:57:29 2009 +0200
@@ -130,7 +130,8 @@
   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;
--- a/src/devices/wifi/qsta-wifi-mac.cc	Fri Jun 26 10:56:59 2009 +0200
+++ b/src/devices/wifi/qsta-wifi-mac.cc	Fri Jun 26 12:57:29 2009 +0200
@@ -484,9 +484,15 @@
 }
 
 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 @@
         {
           goodBeacon = true;
         }
-      if (IsAssociated () && hdr->GetAddr3 () != GetBssid ())
+      if ((IsWaitAssocResp () || IsAssociated ()) && hdr->GetAddr3 () != GetBssid ())
         {
           goodBeacon = false;
         }
--- a/src/devices/wifi/qsta-wifi-mac.h	Fri Jun 26 10:56:59 2009 +0200
+++ b/src/devices/wifi/qsta-wifi-mac.h	Fri Jun 26 12:57:29 2009 +0200
@@ -101,7 +101,8 @@
   void SendAssociationRequest (void);
   void SendProbeRequest (void);
   void TryToEnsureAssociated (void);
-  bool IsAssociated (void);
+  bool IsAssociated (void) const;
+  bool IsWaitAssocResp (void) const;
   virtual void DoDispose (void);
 
  /**