Skip to content

Commit

Permalink
fixes #8
Browse files Browse the repository at this point in the history
I'm pretty sure the problem is that OS X does not allow the WiFi chip to enter promiscuous mode while it is associated with a network. Now we force the user to disassociate right before initializing libpcap.
  • Loading branch information
unixpickle authored and Alex Nichol committed Nov 23, 2015
1 parent 17176cc commit 0605505
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Wireless/ANWiFiSniffer.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ - (void)backgroundThread {
}
[channelLock lock];
if (hopChannel) {
[[interface interface] setWLANChannel:hopChannel error:nil];
[interface setChannel:hopChannel.channelNumber];
hopChannel = nil;
}
[channelLock unlock];
Expand Down
1 change: 1 addition & 0 deletions Wireless/Tapping/ANInterface.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ @implementation ANInterface
- (id)initWithInterface:(NSString *)name {
if ((self = [super init])) {
interface = [[CWInterface alloc] initWithInterfaceName:name];
[interface disassociate];
if (!interface) return nil;
pcapHandle = pcap_open_live([name UTF8String], 65536, 1, 1, pcapError);
if (!pcapHandle) return nil;
Expand Down

0 comments on commit 0605505

Please sign in to comment.