| 1 |
--- airodump-ng.c 2006-04-24 01:29:17.578125000 +0200 |
| 2 |
+++ airodump-ng-patched.c 2006-05-01 16:28:07.531250000 +0200 |
| 3 |
@@ -1690,37 +1690,54 @@ |
| 4 |
int pid, status; |
| 5 |
struct iwreq wrq; |
| 6 |
|
| 7 |
- if( G.is_wlanng ) |
| 8 |
- { |
| 9 |
- if( ( pid = fork() ) == 0 ) |
| 10 |
- { |
| 11 |
- close( 0 ); close( 1 ); close( 2 ); chdir( "/" ); |
| 12 |
- execlp( "wlanctl-ng", "wlanctl-ng", interface, |
| 13 |
- "lnxreq_wlansniff", "enable=true", |
| 14 |
- "prismheader=true", "wlanheader=false", |
| 15 |
- "stripfcs=true", "keepwepflags=true", NULL ); |
| 16 |
- exit( 1 ); |
| 17 |
- } |
| 18 |
- |
| 19 |
- waitpid( pid, &status, 0 ); |
| 20 |
- |
| 21 |
- if( WIFEXITED(status) ) |
| 22 |
- return( WEXITSTATUS(status) ); |
| 23 |
- return( 1 ); |
| 24 |
- } |
| 25 |
- |
| 26 |
- memset( &wrq, 0, sizeof( struct iwreq ) ); |
| 27 |
- strncpy( wrq.ifr_name, interface, IFNAMSIZ ); |
| 28 |
- wrq.u.mode = IW_MODE_MONITOR; |
| 29 |
- |
| 30 |
- if( ioctl( fd_raw, SIOCSIWMODE, &wrq ) < 0 ) |
| 31 |
- { |
| 32 |
- perror( "ioctl(SIOCSIWMODE) failed" ); |
| 33 |
- return( 1 ); |
| 34 |
- } |
| 35 |
- |
| 36 |
- set_channel( interface, fd_raw, 10 ); |
| 37 |
- |
| 38 |
+ if( strcmp(interface,"prism0") == 0 ) |
| 39 |
+ { |
| 40 |
+ if( ( pid = fork() ) == 0 ) |
| 41 |
+ { |
| 42 |
+ close( 0 ); close( 1 ); close( 2 ); chdir( "/" ); |
| 43 |
+ execlp( "wl", "wl", "monitor", "1", NULL); |
| 44 |
+ exit( 1 ); |
| 45 |
+ } |
| 46 |
+ waitpid(pid, &status,0); |
| 47 |
+ if( WIFEXITED(status) ) |
| 48 |
+ return( WEXITSTATUS(status) ); |
| 49 |
+ return( 1 ); |
| 50 |
+ } |
| 51 |
+ else |
| 52 |
+ { |
| 53 |
+ if( G.is_wlanng ) |
| 54 |
+ { |
| 55 |
+ if( ( pid = fork() ) == 0 ) |
| 56 |
+ { |
| 57 |
+ close( 0 ); close( 1 ); close( 2 ); chdir( "/" ); |
| 58 |
+ execlp( "wlanctl-ng", "wlanctl-ng", interface, |
| 59 |
+ "lnxreq_wlansniff", "enable=true", |
| 60 |
+ "prismheader=true", "wlanheader=false", |
| 61 |
+ "stripfcs=true", "keepwepflags=true", NULL ); |
| 62 |
+ exit( 1 ); |
| 63 |
+ } |
| 64 |
+ |
| 65 |
+ waitpid( pid, &status, 0 ); |
| 66 |
+ |
| 67 |
+ if( WIFEXITED(status) ) |
| 68 |
+ return( WEXITSTATUS(status) ); |
| 69 |
+ return( 1 ); |
| 70 |
+ } |
| 71 |
+ |
| 72 |
+ memset( &wrq, 0, sizeof( struct iwreq ) ); |
| 73 |
+ strncpy( wrq.ifr_name, interface, IFNAMSIZ ); |
| 74 |
+ wrq.u.mode = IW_MODE_MONITOR; |
| 75 |
+ |
| 76 |
+ if( ioctl( fd_raw, SIOCSIWMODE, &wrq ) < 0 ) |
| 77 |
+ { |
| 78 |
+ perror( "ioctl(SIOCSIWMODE) failed" ); |
| 79 |
+ return( 1 ); |
| 80 |
+ } |
| 81 |
+ |
| 82 |
+ } |
| 83 |
+ |
| 84 |
+ set_channel( interface, fd_raw, 10 ); |
| 85 |
+ |
| 86 |
return( 0 ); |
| 87 |
} |
| 88 |
|