ref: 35d616d9728984b11a7df0943206a60840b9ae6d
parent: 7c1c4221787b3795974a382807d4204e6fc17203
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Mon Jun 24 18:47:07 EDT 2013
wifi: signal ap deassociation to aux/wpa with a zero length read. aux/wpa needs to reset its reply counter on deassociation to properly restart key negotiation. we signal this with a zero length read on the connections filtering for eapol protocol.
--- a/sys/src/9/pc/wifi.c
+++ b/sys/src/9/pc/wifi.c
@@ -346,6 +346,25 @@
}
}
+/* notify aux/wpa with a zero length write that we got deassociated from the ap */
+static void
+wifideassoc(Wifi *wifi)
+{+ Ether *ether;
+ Netfile *f;
+ int i;
+
+ ether = wifi->ether;
+ for(i=0; i<ether->nfile; i++){+ f = ether->f[i];
+ if(f == nil || f->in == nil || f->inuse == 0 || f->type != 0x888e)
+ continue;
+ if(wifi->debug)
+ print("#%d: wifideassoc: %#p\n", ether->ctlrno, f);+ qwrite(f->in, 0, 0);
+ }
+}
+
/* check if a node qualifies as our bss matching bssid and essid */
static int
goodbss(Wifi *wifi, Wnode *wn)
@@ -429,6 +448,7 @@
memset(wn->rxkey, 0, sizeof(wn->rxkey));
memset(wn->txkey, 0, sizeof(wn->txkey));
wn->aid = 0;
+ wifideassoc(wifi);
sendauth(wifi, wn);
break;
}
--
⑨