code: plan9front

Download patch

ref: f28d61ca22c711e9449320f4ad13e71e8a2c2a5a
parent: 3f0f52ab69a8e821fcd1ac66b8d509ee3074c266
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;
 	}