Fixed a bug in IcmpProtocol::frameFieldCount() which would return incorrect values sometimes
This commit is contained in:
parent
11acbf201d
commit
710eb7f836
@ -135,12 +135,15 @@ int IcmpProtocol::fieldCount() const
|
|||||||
|
|
||||||
int IcmpProtocol::frameFieldCount() const
|
int IcmpProtocol::frameFieldCount() const
|
||||||
{
|
{
|
||||||
int count = AbstractProtocol::frameFieldCount();
|
int count;
|
||||||
|
|
||||||
|
if (idSeqSet.contains(fieldData(icmp_type, FieldValue).toUInt()))
|
||||||
|
count = icmp_idSeqFrameFieldCount;
|
||||||
|
else
|
||||||
|
count = icmp_commonFrameFieldCount;
|
||||||
|
|
||||||
if (!idSeqSet.contains(fieldData(icmp_type, FieldValue).toUInt()))
|
|
||||||
count -=2;
|
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractProtocol::FieldFlags IcmpProtocol::fieldFlags(int index) const
|
AbstractProtocol::FieldFlags IcmpProtocol::fieldFlags(int index) const
|
||||||
|
@ -55,11 +55,14 @@ private:
|
|||||||
icmp_type = 0,
|
icmp_type = 0,
|
||||||
icmp_code,
|
icmp_code,
|
||||||
icmp_checksum,
|
icmp_checksum,
|
||||||
icmp_identifier,
|
icmp_commonFrameFieldCount,
|
||||||
|
|
||||||
|
icmp_identifier = icmp_commonFrameFieldCount,
|
||||||
icmp_sequence,
|
icmp_sequence,
|
||||||
|
icmp_idSeqFrameFieldCount,
|
||||||
|
|
||||||
// Meta Fields
|
// Meta Fields
|
||||||
icmp_is_override_checksum,
|
icmp_is_override_checksum = icmp_idSeqFrameFieldCount,
|
||||||
|
|
||||||
icmp_fieldCount
|
icmp_fieldCount
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user