better detection of powersave frame
@@ -1206,9 +1206,14 @@ while(1)
/* power save */
if((macf->type == MAC_TYPE_DATA) && ((macf->subtype == MAC_ST_NULL)|| (macf->subtype == MAC_ST_QOSNULL)))
{
- if((macf->to_ds == 1) && (macf->power == 0))
+ if((macf->from_ds == 0) && (macf->to_ds == 1) && (macf->power == 0))
{
- senddeauth(MAC_ST_DISASSOC, WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, macf->addr1.addr, macf->addr2.addr);
+ senddeauth(MAC_ST_DISASSOC, WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, macf->addr2.addr, macf->addr1.addr);
+ }
+
+ if((macf->from_ds == 1) && (macf->to_ds == 0))
+ {
+ senddeauth(MAC_ST_DISASSOC, WLAN_REASON_DISASSOC_STA_HAS_LEFT, macf->addr1.addr, macf->addr2.addr);
}
continue;
}
