Kismet Wireless

Kismet Forums

 

Posted by:maxux
Subject:ath5k failing to capture source, mode get ioctl failed 22:Invalid argument.
Date:17:50:54 17/12/2014

> > > >
> > > > I'll tweak some code regardless and do a very minor release.
> > >
> > > Try the Kismet-Stable branch in git and see if it fixes things.
> >
> > Done that, still can not capture.
> >
> > The weird thing is there's no fatal error except these two I pasted which shouldn't be fatal. I guess it is something with pcap but really don't no where to look at.
>
> Hi again.
>
> After looking the sources I found the error in the condition on the line 598 of the file packetsource_wext.cc, the function tries to get the mode of the interface using ioctl and fails with this card/module returning error. The thing is this check is not necessary when using mac80211 and could be placed right after the next block - if(use_mac80211) - which checks and set all for the interface using mac80211 and returns.
>
> The condition just looks misplaced there, moved it after the mac80211 stuff and recompiled, it is capturing now.

Thanks for your message, I have the same problem with iwlwifi, and try your fix, it worked !
Here is a patch:

--- packetsource_wext.cc 2013-03-25 18:29:11.000000000 +0100
+++ /tmp/packetsource_wext.cc 2014-12-17 18:05:09.659219780 +0100
@@ -594,15 +594,6 @@
// Yes, gotos suck. Yes, go away
end_vap:

- // Try to grab the wireless mode
- if (Iwconfig_Get_Mode(interface.c_str(), errstr, &stored_mode) < 0) {
- _MSG(errstr, MSGFLAG_PRINTERROR);
- _MSG("Failed to get current wireless mode for interface '" + interface +
- "', check your configuration and consult the Kismet README file",
- MSGFLAG_PRINTERROR);
- return -1;
- }
-
if (use_mac80211) {
int oldflags;
Ifconfig_Get_Flags(interface.c_str(), errstr, &oldflags);
@@ -634,6 +625,16 @@
return 0;
}

+ // Try to grab the wireless mode
+ if (Iwconfig_Get_Mode(interface.c_str(), errstr, &stored_mode) < 0) {
+ _MSG(errstr, MSGFLAG_PRINTERROR);
+ _MSG("Failed to get current wireless mode for interface '" + interface +
+ "', check your configuration and consult the Kismet README file",
+ MSGFLAG_PRINTERROR);
+ return -1;
+ }
+
+
// If it's already in monitor, make sure it's up and we're done
if (stored_mode == LINUX_WLEXT_MONITOR) {
_MSG("Interface '" + interface + "' is already marked as being in "


Reply to this message