ref: 064a987bd8b3f3172bce73522cab9b21587bbc0e
parent: 3ea0572f4f467f8f0712da7040a3dd163ac2dd0e
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Feb 16 15:11:20 EST 2017
wpa: dont send initial "start" message, faster polling interval waiting for connection the kernel will automatically timeout the eap blocked state for us and reassociate for us, so there is no need to provoke the ap to start the wpa/eap handshake. make the polling faster changing the sleep time from 500 to 100 ms.
--- a/sys/src/cmd/aux/wpa.c
+++ b/sys/src/cmd/aux/wpa.c
@@ -208,7 +208,7 @@
}
int
-connected(int assoc)
+connected(void)
{
char status[1024];
@@ -218,10 +218,6 @@
return 0;
if(strcmp(status, "unauthenticated") == 0)
return 0;
- if(assoc){
- if(strcmp(status, "blocked") != 0 && strcmp(status, "associated") != 0)
- return 0;
- }
if(debug)
fprint(2, "status: %s\n", status);
return 1;
@@ -1219,8 +1215,8 @@
Connect:
/* bss scan might not be complete yet, so check for 10 seconds. */
- for(try = 10; (background || try >= 0) && !connected(0); try--)
- sleep(1000);
+ for(try = 100; (background || try >= 0) && !connected(); try--)
+ sleep(100);
ispsk = 1;
if(rsnelen <= 0 || rsne == brsne){
@@ -1286,13 +1282,6 @@
}
}
}
-
- /* wait for getting associated before sending start message */
- for(try = 10; (background || try >= 0) && !connected(1); try--)
- sleep(500);
-
- if(getbssid(conn.amac) == 0)
- eapwrite(&conn, nil, 0);
lastrepc = 0ULL;
for(;;){
--
⑨