git: 9front

Download patch

ref: 82f1937de009f27cb4a2cd78f3501d77cce93bfa
parent: aa520824e29c7906a78af72246ebe1aaa1807131
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Dec 7 10:15:40 EST 2023

aux/wpa: continue trying to connect when forked

The "auth" write can fail when the AP reboots or
vanishes temporarily. Don't sysfatal and continue
trying to connect.

--- a/sys/src/cmd/aux/wpa.c
+++ b/sys/src/cmd/aux/wpa.c
@@ -1242,8 +1242,13 @@
 		 * at once and not chunked up on fprint buffer.
 		 */
 		n = sprint((char*)buf, "auth %.*H", rsnelen, rsne);
-		if(write(cfd, buf, n) != n)
+		if(write(cfd, buf, n) != n){
+			if(forked){
+				sleep(500);
+				goto Connect;
+			}
 			sysfatal("write auth: %r");
+		}
 	} else {
 		authtype = AuthNone;
 	}
--