-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 @@ -726,4 +726,8 @@ OWaveLanManagementPacket::OWaveLanManagementPacket( const unsigned char* end, co - // grab tagged values - const unsigned char* ptr = (const unsigned char*) (_body+1); + // Grab tagged values. + // Beacons contain a 12 byte long fixed parameters set before the tagged parameters come, + // Other management frames don't - which is why we have to inspect the subtype here. + + const unsigned char* ptr = managementType() == "Beacon" ? (const unsigned char*) (_body+1) : (const unsigned char*) (_header+1); + while (ptr < end) |