wifi: fix missed eapol frames

allow the driver to associate the node with a new aid right after
we receive the association response, not just when we transmit
a packet which usualy does not happen as eapol is initiated by
the access point so there are no transmit calls. we just call
transmit from the wifiproc with a nil block to introduce the node.
This commit is contained in:
cinap_lenrek 2013-06-23 07:14:52 +02:00
parent fb22c34833
commit f39374b47e
2 changed files with 10 additions and 2 deletions

View file

@ -1833,7 +1833,6 @@ transmit(Wifi *wifi, Wnode *wn, Block *b)
Wifipkt *w;
char *err;
w = (Wifipkt*)b->rp;
edev = wifi->ether;
ctlr = edev->ctlr;
@ -1850,9 +1849,16 @@ transmit(Wifi *wifi, Wnode *wn, Block *b)
|| memcmp(wn->bssid, ctlr->bssid, Eaddrlen) != 0)
rxon(edev, wn);
if(b == nil){
/* association note has no data to transmit */
qunlock(ctlr);
return;
}
rate = 0;
flags = 0;
nodeid = ctlr->bcastnodeid;
w = (Wifipkt*)b->rp;
if((w->a1[0] & 1) == 0){
flags |= TFlagNeedACK;

View file

@ -417,6 +417,8 @@ wifiproc(void *arg)
case 0x30: /* reassoc response */
b->rp += wifihdrlen(w);
recvassoc(wifi, wn, b->rp, BLEN(b));
/* notify driver about node aid association */
(*wifi->transmit)(wifi, wn, nil);
break;
case 0xb0: /* auth */
setstatus(wifi, Sauth);
@ -673,13 +675,13 @@ wifictl(Wifi *wifi, void *buf, long n)
memmove(wifi->bssid, addr, Eaddrlen);
goto Findbss;
case CMauth:
setstatus(wifi, Sauth);
memset(wn->rxkey, 0, sizeof(wn->rxkey));
memset(wn->txkey, 0, sizeof(wn->txkey));
if(cb->f[1] == nil)
wn->rsnelen = 0;
else
wn->rsnelen = hextob(cb->f[1], nil, wn->rsne, sizeof(wn->rsne));
setstatus(wifi, Sauth);
sendassoc(wifi, wn);
break;
case CMrxkey0: case CMrxkey1: case CMrxkey2: case CMrxkey3: case CMrxkey4: