source: packages/net/aircrack-ng/patches/100-add-ignore-channel-negative-1.patch @ 26910

Last change on this file since 26910 was 26910, checked in by jow, 5 years ago

[packages] aircrack-ng: implement --ignore-negative-one option to cope with cfg80211 monitor mode channel issues

File size: 1.8 KB
  • src/aireplay-ng.c

    a b char usage[] = 
    200200"\n" 
    201201"  Miscellaneous options:\n" 
    202202"\n" 
    203 "      -R        : disable /dev/rtc usage\n" 
     203"      -R                    : disable /dev/rtc usage\n" 
     204"      --ignore-negative-one : if the interface's channel can't be determined,\n" 
     205"                              ignore the mismatch, needed for unpatched cfg80211\n" 
    204206"\n" 
    205207"  Attack modes (numbers can still be used):\n" 
    206208"\n" 
    struct options 
    268270    int bittest; 
    269271 
    270272    int nodetect; 
     273    int ignore_negative_one; 
    271274    int rtc; 
    272275} 
    273276opt; 
    int attack_check(uchar* bssid, char* ess 
    715718 
    716719    iface_chan = wi_get_channel(wi); 
    717720 
     721    if(iface_chan == -1 && !opt.ignore_negative_one) 
     722    { 
     723        PCT; printf("Couldn't determine current channel for %s, you should either force the operation with --ignore-negative-one or apply a kernel patch\n", 
     724                wi_get_ifname(wi)); 
     725        return -1; 
     726    } 
     727 
    718728    if(bssid != NULL) 
    719729    { 
    720730        ap_chan = wait_for_beacon(bssid, capa, essid); 
    int attack_check(uchar* bssid, char* ess 
    723733            PCT; printf("No such BSSID available.\n"); 
    724734            return -1; 
    725735        } 
    726         if(ap_chan != iface_chan) 
     736        if((ap_chan != iface_chan) && (iface_chan != -1 || !opt.ignore_negative_one)) 
    727737        { 
    728738            PCT; printf("%s is on channel %d, but the AP uses channel %d\n", wi_get_ifname(wi), iface_chan, ap_chan); 
    729739            return -1; 
    int main( int argc, char *argv[] ) 
    57655775            {"help",        0, 0, 'H'}, 
    57665776            {"fast",        0, 0, 'F'}, 
    57675777            {"bittest",     0, 0, 'B'}, 
     5778            {"ignore-negative-one", 0, &opt.ignore_negative_one, 1}, 
    57685779            {0,             0, 0,  0 } 
    57695780        }; 
    57705781 
Note: See TracBrowser for help on using the repository browser.