aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Wifi.cpp7
-rw-r--r--src/WifiAP.cpp12
2 files changed, 16 insertions, 3 deletions
diff --git a/src/Wifi.cpp b/src/Wifi.cpp
index 7f774e8..7a9b0a2 100644
--- a/src/Wifi.cpp
+++ b/src/Wifi.cpp
@@ -848,10 +848,11 @@ bool CheckRX(bool block)
continue; // oops. we received a packet we just sent.
bssidmatch = MACEqual(&RXBuffer[12 + a_bss], (u8*)&IOPORT(W_BSSID0));
- if (!(IOPORT(W_BSSID0) & 0x0001) && !(RXBuffer[12 + a_bss] & 0x01) &&
- !bssidmatch)
+ //if (!(IOPORT(W_BSSID0) & 0x0001) && !(RXBuffer[12 + a_bss] & 0x01) &&
+ if (!MACEqual(&RXBuffer[12 + a_dst], (u8*)&IOPORT(W_MACAddr0)) &&
+ !(RXBuffer[12 + a_dst] & 0x01))
{
- printf("received packet %04X but it didn't pass the BSSID check\n", framectl);
+ printf("received packet %04X but it didn't pass the MAC check\n", framectl);
continue;
}
diff --git a/src/WifiAP.cpp b/src/WifiAP.cpp
index 1472425..f8c9f79 100644
--- a/src/WifiAP.cpp
+++ b/src/WifiAP.cpp
@@ -150,6 +150,9 @@ int HandleManagementFrame(u8* data, int len)
{
case 0x0: // assoc request
{
+ if (!MACEqual(&data[16], (u8*)APMac)) // check BSSID
+ return 0;
+
if (ClientStatus != 1)
{
printf("wifiAP: bad assoc request, needs auth prior\n");
@@ -203,6 +206,9 @@ int HandleManagementFrame(u8* data, int len)
case 0xA: // deassoc
{
+ if (!MACEqual(&data[16], (u8*)APMac)) // check BSSID
+ return 0;
+
ClientStatus = 1;
printf("wifiAP: client deassociated\n");
@@ -222,6 +228,9 @@ int HandleManagementFrame(u8* data, int len)
case 0xB: // auth
{
+ if (!MACEqual(&data[16], (u8*)APMac)) // check BSSID
+ return 0;
+
ClientStatus = 1;
printf("wifiAP: client authenticated\n");
@@ -243,6 +252,9 @@ int HandleManagementFrame(u8* data, int len)
case 0xC: // deauth
{
+ if (!MACEqual(&data[16], (u8*)APMac)) // check BSSID
+ return 0;
+
ClientStatus = 0;
printf("wifiAP: client deauthenticated\n");