IPv4: use calculated value for Header Length display filter

Bug: 12387
Change-Id: I63370ea884b6fb75a0743fecc06af2e213700645
Reviewed-on: https://code.wireshark.org/review/15163
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Pascal Quantin 2016-04-29 16:25:03 +02:00 committed by Anders Broman
parent 708f4f9dd8
commit f29d1da0fb
1 changed files with 4 additions and 4 deletions

View File

@ -2052,13 +2052,13 @@ dissect_ip_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
"Bogus IP header length (%u, must be at least %u)",
hlen, IPH_MIN_LEN);
proto_tree_add_uint_format_value(ip_tree, hf_ip_hdr_len, tvb, offset, 1, hlen/4,
proto_tree_add_uint_bits_format_value(ip_tree, hf_ip_hdr_len, tvb, (offset<<3)+4, 4, hlen,
"%u bytes (bogus, must be at least %u)", hlen, IPH_MIN_LEN);
return tvb_captured_length(tvb);
}
proto_tree_add_uint_format_value(ip_tree, hf_ip_hdr_len, tvb, offset, 1, hlen/4,
"%u bytes", hlen);
proto_tree_add_uint_bits_format_value(ip_tree, hf_ip_hdr_len, tvb, (offset<<3)+4, 4, hlen,
"%u bytes (%u)", hlen, hlen>>2);
iph->ip_tos = tvb_get_guint8(tvb, offset + 1);
if (g_ip_dscp_actif) {
@ -2624,7 +2624,7 @@ proto_register_ip(void)
{ &hf_ip_hdr_len,
{ "Header Length", "ip.hdr_len", FT_UINT8, BASE_DEC,
NULL, 0x0F, NULL, HFILL }},
NULL, 0x0, NULL, HFILL }},
{ &hf_ip_dsfield,
{ "Differentiated Services Field", "ip.dsfield", FT_UINT8, BASE_HEX,