IP: Fix fragment offset value calculation

The bitmask was applied twice, through the header_field_info
 and before calling proto_tree_add_uint.
Now using _format_value for correct calculation.
This commit is contained in:
Alexander Funke 2022-10-20 14:49:58 +02:00 committed by A Wireshark GitLab Utility
parent 375cd6392e
commit 1ab15061b5
1 changed files with 2 additions and 1 deletions

View File

@ -2041,7 +2041,8 @@ dissect_ip_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
ett_ip_flags, ip_flags, ENC_BIG_ENDIAN, BMT_NO_FALSE | BMT_NO_TFS | BMT_NO_INT);
}
tf = proto_tree_add_uint(ip_tree, hf_ip_frag_offset, tvb, offset + 6, 2, (iph->ip_off & IP_OFFSET)*8);
tf = proto_tree_add_uint_format_value(ip_tree, hf_ip_frag_offset, tvb, offset + 6, 2,
iph->ip_off, "%u", (iph->ip_off & IP_OFFSET) * 8);
iph->ip_ttl = tvb_get_guint8(tvb, offset + 8);
ttl_item = proto_tree_add_item(ip_tree, hf_ip_ttl, tvb, offset + 8, 1, ENC_BIG_ENDIAN);