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:
parent
2028d0f25b
commit
be984135ac
@ -73,7 +73,9 @@ void PdmlIp4Protocol::unknownFieldHandler(QString name, int /*pos*/,
|
|||||||
{
|
{
|
||||||
OstProto::Ip4 *ip4 = pbProto->MutableExtension(OstProto::ip4);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user