]> git.lizzy.rs Git - plan9front.git/commitdiff
etheriwl: allow switching channels in promisc mode
authorcinap_lenrek <cinap_lenrek@gmx.de>
Sun, 23 Jun 2013 16:27:17 +0000 (18:27 +0200)
committercinap_lenrek <cinap_lenrek@gmx.de>
Sun, 23 Jun 2013 16:27:17 +0000 (18:27 +0200)
promisc mode prevented the call to rxon() in transmit
possibly causing association to fail while running snoopy.

sys/src/9/pc/etheriwl.c

index 02b7de2e6a109f80da08a2e974f0eeb44fedfb0a..6c0a1a8ff77752b2038a32afb3caf4906caf491f 100644 (file)
@@ -1723,6 +1723,8 @@ rxon(Ether *edev, Wnode *bss)
        filter = FilterNoDecrypt | FilterMulticast | FilterBeacon;
        if(ctlr->prom){
                filter |= FilterPromisc;
+               if(bss != nil)
+                       ctlr->channel = bss->channel;
                bss = nil;
        }
        if(bss != nil){
@@ -1843,10 +1845,8 @@ transmit(Wifi *wifi, Wnode *wn, Block *b)
                return;
        }
 
-       if(ctlr->prom == 0)
-       if(wn->aid != ctlr->aid
-       || wn->channel != ctlr->channel
-       || memcmp(wn->bssid, ctlr->bssid, Eaddrlen) != 0)
+       if((wn->channel != ctlr->channel)
+       || (!ctlr->prom && (wn->aid != ctlr->aid || memcmp(wn->bssid, ctlr->bssid, Eaddrlen) != 0)))
                rxon(edev, wn);
 
        if(b == nil){