Fix diff in pcap import of IPv4 due to ip.flags

Some Wireshark/tshark versions have ip.flags as u16 instead of u8. Code
changed to be able to handle both.

Tested with Wireshark 3.2.4 (u16) and 1.14 (u8)
This commit is contained in:
Srivats P 2020-06-04 21:02:09 +05:30
parent 2028d0f25b
commit be984135ac

View File

@ -73,7 +73,9 @@ void PdmlIp4Protocol::unknownFieldHandler(QString name, int /*pos*/,
{
OstProto::Ip4 *ip4 = pbProto->MutableExtension(OstProto::ip4);
ip4->set_flags(attributes.value("value").toString().toUInt(&isOk, kBaseHex) >> 5);
int shift = attributes.value("size").toString().toUInt(&isOk) == 2 ?
13 : 5;
ip4->set_flags(attributes.value("value").toString().toUInt(&isOk, kBaseHex) >> shift);
}
}