git: 9front

Download patch

ref: 7c1c4221787b3795974a382807d4204e6fc17203
parent: c432cc7c917fa3be517c9f71a37f66a2d65ec7d9
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sun Jun 23 14:27:17 EDT 2013

etheriwl: allow switching channels in promisc mode

promisc mode prevented the call to rxon() in transmit
possibly causing association to fail while running snoopy.

--- a/sys/src/9/pc/etheriwl.c
+++ b/sys/src/9/pc/etheriwl.c
@@ -1723,6 +1723,8 @@
 	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 @@
 		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){
--