Skip to content

Commit

Permalink
Fix 1537 double-association when pairing
Browse files Browse the repository at this point in the history
  • Loading branch information
medusalix committed May 23, 2020
1 parent 6c5bda7 commit fd289dd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dongle/mt76.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ bool Mt76::beforeClose()

void Mt76::handleWlanPacket(const Bytes &packet)
{
const RxWi *rxWi = packet.toStruct<RxWi>();
const WlanFrame *wlanFrame = packet.toStruct<WlanFrame>(sizeof(RxWi));

const Bytes source(
Expand Down Expand Up @@ -104,6 +105,26 @@ void Mt76::handleWlanPacket(const Bytes &packet)
clientConnected(wcid, source);
}

// Only kept for compatibility with 1537 controllers
// They associate, disassociate and associate again during pairing
// Disassociations happen without triggering EVT_CLIENT_LOST
else if (subtype == MT_WLAN_DISASSOC)
{
Log::debug(
"Client disassociating: %s",
Log::formatBytes(source).c_str()
);

if (!removeClient(rxWi->wcid))
{
Log::error("Failed to remove client");

return;
}

clientDisconnected(rxWi->wcid);
}

// Reserved frames are used for different purposes
// Most of them are yet to be discovered
else if (subtype == MT_WLAN_RESERVED)
Expand Down

0 comments on commit fd289dd

Please sign in to comment.