-rw-r--r-- | libopie2/opienet/opcap.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index 4d786f5..7463320 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp | |||
@@ -721,14 +721,18 @@ OWaveLanManagementPacket::OWaveLanManagementPacket( const unsigned char* end, co | |||
721 | :QObject( parent, "802.11 Management" ), _header( data ), | 721 | :QObject( parent, "802.11 Management" ), _header( data ), |
722 | _body( (const struct ieee_802_11_mgmt_body*) (data+1) ) | 722 | _body( (const struct ieee_802_11_mgmt_body*) (data+1) ) |
723 | { | 723 | { |
724 | odebug << "OWaveLanManagementPacket::OWaveLanManagementPacket(): decoding frame..." << oendl; | 724 | odebug << "OWaveLanManagementPacket::OWaveLanManagementPacket(): decoding frame..." << oendl; |
725 | odebug << "Detected subtype is " << managementType() << oendl; | 725 | odebug << "Detected subtype is " << managementType() << oendl; |
726 | 726 | ||
727 | // grab tagged values | 727 | // Grab tagged values. |
728 | const unsigned char* ptr = (const unsigned char*) (_body+1); | 728 | // Beacons contain a 12 byte long fixed parameters set before the tagged parameters come, |
729 | // Other management frames don't - which is why we have to inspect the subtype here. | ||
730 | |||
731 | const unsigned char* ptr = managementType() == "Beacon" ? (const unsigned char*) (_body+1) : (const unsigned char*) (_header+1); | ||
732 | |||
729 | while (ptr < end) | 733 | while (ptr < end) |
730 | { | 734 | { |
731 | switch ( *ptr ) | 735 | switch ( *ptr ) |
732 | { | 736 | { |
733 | case E_SSID: new OWaveLanManagementSSID( end, (struct ssid_t*) ptr, this ); break; | 737 | case E_SSID: new OWaveLanManagementSSID( end, (struct ssid_t*) ptr, this ); break; |
734 | case E_FH: new OWaveLanManagementFH( end, (struct fh_t*) ptr, this ); break; | 738 | case E_FH: new OWaveLanManagementFH( end, (struct fh_t*) ptr, this ); break; |