From: Javier Palacios Date: Mon, 23 Jul 2012 13:35:34 +0000 (+0200) Subject: Bugfixes X-Git-Url: http://git.maemo.org/git/?p=wifihood;a=commitdiff_plain;h=5bf06bebbfa65040423d0013ea11df361abb4bc1 Bugfixes --- diff --git a/wifisniffer/wifilogger.py b/wifisniffer/wifilogger.py index 34c6c2f..8b44527 100755 --- a/wifisniffer/wifilogger.py +++ b/wifisniffer/wifilogger.py @@ -3,7 +3,11 @@ import pcapy import struct +import pyiw +import threading + iface = 'wlan0' +wlan = pyiw.WirelessInterface(iface) import time @@ -137,8 +141,13 @@ def dealWithPacket ( hdr , data ) : frame_subtype = name break else : - print "ERROR : unknown CTL subtype %s" % ( frame_ctl & 0xf0 , ) - return + if frame_ctl & 0xf0 == 144 : + frame_subtype = "CF_END_ACK" + elif frame_ctl & 0xf0 == 128 : + frame_subtype = "UNKNOWN_1" + else : + print "ERROR : unknown CTL subtype %s" % ( frame_ctl & 0xf0 , ) + return elif frame_type == "DATA" : _subtype = [] @@ -181,7 +190,7 @@ def dealWithPacket ( hdr , data ) : sequence = ( -1 , -1 ) - if frame_type == "DATA" : + if frame_type == "DATA" and pcktlen > 6 : maclist.append( mac_fmt % struct.unpack( mac_str , payload[pointer:pointer+6] ) ) pointer += 6 pcktlen -= 6 @@ -211,6 +220,7 @@ try : except CaptureEnd , ex : print "FINISED : %s" % ex except Exception , ex : + channel_hop[0] = 0 print "ERROR : %s" % ex logfile.close()