@@ -144,8 +144,10 @@ void Ieee80211MgmtAp::handleAuthenticationFrame(Packet *packet, const Ptr<const
144144 // receives authentication frame number 1 from STA, which will cause the AP to return an Auth-Error
145145 // making the MN STA to start the handover process all over again.
146146 if (frameAuthSeq == 1 ) {
147- if (mib->bssAccessPointData .stations [sta->address ] == Ieee80211Mib::ASSOCIATED )
147+ if (mib->bssAccessPointData .stations [sta->address ] == Ieee80211Mib::ASSOCIATED ) {
148148 sendDisAssocNotification (sta->address );
149+ mib->releaseAssociationId (sta->address );
150+ }
149151 mib->bssAccessPointData .stations [sta->address ] = Ieee80211Mib::NOT_AUTHENTICATED ;
150152 sta->authSeqExpected = 1 ;
151153 }
@@ -179,8 +181,10 @@ void Ieee80211MgmtAp::handleAuthenticationFrame(Packet *packet, const Ptr<const
179181
180182 // update status
181183 if (isLast) {
182- if (mib->bssAccessPointData .stations [sta->address ] == Ieee80211Mib::ASSOCIATED )
184+ if (mib->bssAccessPointData .stations [sta->address ] == Ieee80211Mib::ASSOCIATED ) {
183185 sendDisAssocNotification (sta->address );
186+ mib->releaseAssociationId (sta->address );
187+ }
184188 mib->bssAccessPointData .stations [sta->address ] = Ieee80211Mib::AUTHENTICATED ; // TODO only when ACK of this frame arrives
185189 EV << " STA authenticated\n " ;
186190 }
@@ -199,8 +203,10 @@ void Ieee80211MgmtAp::handleDeauthenticationFrame(Packet *packet, const Ptr<cons
199203
200204 if (sta) {
201205 // mark STA as not authenticated; alternatively, it could also be removed from staList
202- if (mib->bssAccessPointData .stations [sta->address ] == Ieee80211Mib::ASSOCIATED )
206+ if (mib->bssAccessPointData .stations [sta->address ] == Ieee80211Mib::ASSOCIATED ) {
203207 sendDisAssocNotification (sta->address );
208+ mib->releaseAssociationId (sta->address );
209+ }
204210 mib->bssAccessPointData .stations [sta->address ] = Ieee80211Mib::NOT_AUTHENTICATED ;
205211 sta->authSeqExpected = 1 ;
206212 }
@@ -282,8 +288,10 @@ void Ieee80211MgmtAp::handleDisassociationFrame(Packet *packet, const Ptr<const
282288 delete packet;
283289
284290 if (sta) {
285- if (mib->bssAccessPointData .stations [sta->address ] == Ieee80211Mib::ASSOCIATED )
291+ if (mib->bssAccessPointData .stations [sta->address ] == Ieee80211Mib::ASSOCIATED ) {
286292 sendDisAssocNotification (sta->address );
293+ mib->releaseAssociationId (sta->address );
294+ }
287295 mib->bssAccessPointData .stations [sta->address ] = Ieee80211Mib::AUTHENTICATED ;
288296 }
289297}
@@ -348,6 +356,7 @@ void Ieee80211MgmtAp::stop()
348356{
349357 cancelEvent (beaconTimer);
350358 staList.clear ();
359+ mib->bssAccessPointData .associationIds .clear ();
351360 Ieee80211MgmtApBase::stop ();
352361}
353362
0 commit comments