git: 9front

Download patch

ref: ca8812641c1d6e0c2b4bf16a566e099510fa082c
parent: 776a6626f95123ddf63e88e98d31af7a0968cdbd
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(;;){
--