improved error handling on damaged BEACON frames
@@ -156,7 +156,7 @@ static long int awdlcount;
static long int beaconcount;
static long int beaconssidunsetcount;
static long int beaconssidzeroedcount;
-static long int beaconoversizedcount;
+static long int beaconssidoversizedcount;
static long int beaconhcxcount;
static long int beaconerrorcount;
static long int pagcount;
@@ -448,7 +448,7 @@ awdlcount = 0;
beaconcount = 0;
beaconssidunsetcount = 0;
beaconssidzeroedcount = 0;
-beaconoversizedcount = 0;
+beaconssidoversizedcount = 0;
beaconhcxcount = 0;
beaconerrorcount = 0;
pagcount = 0;
@@ -594,6 +594,7 @@ if(wdscount > 0) printf("WIRELESS DISTRIBUTION SYSTEM.............: %ld\n", wd
if(beaconcount > 0) printf("BEACON (total)...........................: %ld\n", beaconcount);
if(beaconssidunsetcount > 0) printf("BEACON (SSID unset)......................: %ld\n", beaconssidunsetcount);
if(beaconssidzeroedcount > 0) printf("BEACON (SSID zeroed).....................: %ld\n", beaconssidzeroedcount);
+if(beaconssidoversizedcount > 0) printf("BEACON (oversized SSID length)...........: %ld\n", beaconssidoversizedcount);
if(pagcount > 0) printf("BEACON (pwnagotchi)......................: %ld\n", pagcount);
if(beaconhcxcount > 0) printf("BEACON (hcxhash2cap).....................: %ld\n", beaconhcxcount);
if(actioncount > 0) printf("ACTION (total)...........................: %ld\n", actioncount);
@@ -4023,8 +4024,17 @@ if(apinfoptr[0] == TAG_PAG)
{
if(processpag(macap, apinfolen, apinfoptr) == true) return;
}
-if(beaconlen < (int)IETAG_SIZE) return;
-if(gettags(apinfolen, apinfoptr, &tags) == false) return;
+if(beaconlen < (int)IETAG_SIZE)
+ {
+ beaconerrorcount++;
+ return;
+ }
+if(gettags(apinfolen, apinfoptr, &tags) == false)
+ {
+ beaconerrorcount++;
+ if(tags.essidlen > 32) beaconssidoversizedcount++;
+ return;
+ }
if(tags.essidlen == 0)
{
beaconssidunsetcount++;
