From 064a987bd8b3f3172bce73522cab9b21587bbc0e Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 16 Feb 2017 20:11:20 +0100 Subject: 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. --- sys/src/cmd/aux/wpa.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'sys/src/cmd/aux/wpa.c') diff --git a/sys/src/cmd/aux/wpa.c b/sys/src/cmd/aux/wpa.c index 76551d7eb..39a3be574 100644 --- a/sys/src/cmd/aux/wpa.c +++ b/sys/src/cmd/aux/wpa.c @@ -208,7 +208,7 @@ getbssid(uchar mac[Eaddrlen]) } int -connected(int assoc) +connected(void) { char status[1024]; @@ -218,10 +218,6 @@ connected(int assoc) 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 @@ main(int argc, char *argv[]) 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){ @@ -1287,13 +1283,6 @@ Connect: } } - /* 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(;;){ uchar *p, *e, *m; -- cgit v1.2.3