Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #1687: madwifi_deauth_reason_codes.diff

File madwifi_deauth_reason_codes.diff, 3.8 kB (added by Tomasz Rostanski <rozteck@interia.pl>, 14 years ago)

The patch recording reason codes from last received deauth/disassoc frames and auth on failure. Signed-off-by: Tomasz Rostanski <rozteck@interia.pl>

  • madwifi/net80211/ieee80211_input.c

    old new  
    34683468                                "%sassoc failed (reason %d)", 
    34693469                                ISREASSOC(subtype) ?  "re" : "", status); 
    34703470                        vap->iv_stats.is_rx_auth_fail++;        /* XXX */ 
     3471                        vap->iv_stats.is_rx_auth_fail_code = status; 
     3472                        IEEE80211_ADDR_COPY(vap->iv_stats.is_rx_auth_fail_from, 
     3473                                wh->i_addr2); 
    34713474                        ieee80211_new_state(vap, IEEE80211_S_SCAN, 
    34723475                                IEEE80211_SCAN_FAIL_STATUS); 
    34733476                        return; 
     
    35963599                IEEE80211_VERIFY_LENGTH(efrm - frm, 2); 
    35973600                reason = le16toh(*(__le16 *)frm); 
    35983601                vap->iv_stats.is_rx_deauth++; 
     3602                vap->iv_stats.is_rx_deauth_code = reason; 
     3603                IEEE80211_ADDR_COPY(vap->iv_stats.is_rx_deauth_from, 
     3604                        wh->i_addr2); 
    35993605                IEEE80211_NODE_STAT(ni, rx_deauth); 
    36003606 
    36013607                IEEE80211_NOTE(vap, IEEE80211_MSG_AUTH, ni, 
     
    36323638                IEEE80211_VERIFY_LENGTH(efrm - frm, 2); 
    36333639                reason = le16toh(*(__le16 *)frm); 
    36343640                vap->iv_stats.is_rx_disassoc++; 
     3641                vap->iv_stats.is_rx_disassoc_code = reason; 
     3642                IEEE80211_ADDR_COPY(vap->iv_stats.is_rx_disassoc_from, 
     3643                        wh->i_addr2); 
     3644 
    36353645                IEEE80211_NODE_STAT(ni, rx_disassoc); 
    36363646 
    36373647                IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni, 
  • madwifi/net80211/ieee80211_ioctl.h

    old new  
    124124        u_int32_t is_rx_ssidmismatch;   /* rx frame ssid mismatch  */ 
    125125        u_int32_t is_rx_auth_unsupported;/* rx w/ unsupported auth alg */ 
    126126        u_int32_t is_rx_auth_fail;      /* rx sta auth failure */ 
     127        u_int32_t is_rx_auth_fail_code; /* rx sta auth failure reason */ 
     128        u_int8_t  is_rx_auth_fail_from[IEEE80211_ADDR_LEN]; /* rx sta auth failure with bss */ 
    127129        u_int32_t is_rx_auth_countermeasures;/* rx auth discard due to CM */ 
    128130        u_int32_t is_rx_assoc_bss;      /* rx assoc from wrong bssid */ 
    129131        u_int32_t is_rx_assoc_notauth;  /* rx assoc w/o auth */ 
     
    131133        u_int32_t is_rx_assoc_norate;   /* rx assoc w/ no rate match */ 
    132134        u_int32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */ 
    133135        u_int32_t is_rx_deauth;         /* rx deauthentication */ 
     136        u_int32_t is_rx_deauth_code;    /* rx deauthentication reason */ 
     137        u_int8_t  is_rx_deauth_from[IEEE80211_ADDR_LEN];  /* rx deauthentication from bss */ 
    134138        u_int32_t is_rx_disassoc;       /* rx disassociation */ 
     139        u_int32_t is_rx_disassoc_code;  /* rx disassociation reason */ 
     140        u_int8_t  is_rx_disassoc_from[IEEE80211_ADDR_LEN]; /* rx disassociation from bss */ 
    135141        u_int32_t is_rx_badsubtype;     /* rx frame w/ unknown subtype*/ 
    136142        u_int32_t is_rx_nobuf;          /* rx failed for lack of buf */ 
    137143        u_int32_t is_rx_decryptcrc;     /* rx decrypt failed on crc */ 
  • madwifi/tools/80211stats.c

    old new  
    101101        STAT(rx_ssidmismatch,   "rx frame ssid mismatch"); 
    102102        STAT(rx_auth_unsupported,"rx w/ unsupported auth alg"); 
    103103        STAT(rx_auth_fail,      "rx sta auth failure"); 
     104        STAT(rx_auth_fail_code, "rx last sta auth failure reason"); 
    104105        STAT(rx_auth_countermeasures, 
    105106                "rx sta auth failure due to TKIP countermeasures"); 
    106107        STAT(rx_assoc_bss,      "rx assoc from wrong bssid"); 
     
    109110        STAT(rx_assoc_norate,   "rx assoc w/ no rate match"); 
    110111        STAT(rx_assoc_badwpaie, "rx assoc w/ bad WPA IE"); 
    111112        STAT(rx_deauth,         "rx deauthentication"); 
     113        STAT(rx_deauth_code,    "rx last deauthentication reason"); 
    112114        STAT(rx_disassoc,       "rx disassociation"); 
     115        STAT(rx_disassoc_code,  "rx last disassociation reason"); 
    113116        STAT(rx_badsubtype,     "rx frame w/ unknown subtype"); 
    114117        STAT(rx_nobuf,          "rx failed for lack of sk_buffer"); 
    115118        STAT(rx_decryptcrc,     "rx decrypt failed on crc");