diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-04-29 16:25:03 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-04-30 07:22:16 +0000 |
commit | f29d1da0fbc86d84bceccda13cf226bce63f226f (patch) | |
tree | 8ad3dd5fdc508a6a7e5b665eec2bb4a84ec6161c /epan/dissectors/packet-ip.c | |
parent | 708f4f9dd83ef4cd8b530b99e2f7c3fdb2627c8d (diff) |
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>
Diffstat (limited to 'epan/dissectors/packet-ip.c')
-rw-r--r-- | epan/dissectors/packet-ip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 6bcabf9266..09f74ce48c 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -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, |