diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-03-26 18:08:05 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-03-26 18:08:05 +0000 |
commit | 67ffb10e649188e64cdb58419ffecfba20e19c0d (patch) | |
tree | ad004308ff67c1d9f6f2b6afac58e4e5cf218b9b /epan/dissectors/packet-icmp.c | |
parent | 584c14c66cc55a88af24b4326f4e789bb6f09c11 (diff) |
Add checksum_bad, set to FALSE to the tree when the checksum is correct. Use PROTO_ITEM_SET_HIDDEN instead of PROTO_ITEM_SET_GENERATED so ICMP and ICMPv6 are consistent.
See: http://ask.wireshark.org/questions/19844/icmp-display-filter-checksum_bad-ignored
#BACKPORT(1.6, 1.8)
svn path=/trunk/; revision=48563
Diffstat (limited to 'epan/dissectors/packet-icmp.c')
-rw-r--r-- | epan/dissectors/packet-icmp.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index d7c8cad94f..d4bdaba05c 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -881,19 +881,22 @@ dissect_extensions(tvbuff_t * tvb, gint offset, proto_tree * tree) tvb, offset + 2, 2, cksum, "Checksum: 0x%04x [correct]", cksum); - } else { hidden_item = proto_tree_add_boolean(ext_tree, hf_icmp_ext_checksum_bad, tvb, - offset + 2, 2, TRUE); - PROTO_ITEM_SET_HIDDEN(hidden_item); - + offset + 2, 2, FALSE); + } else { proto_tree_add_uint_format(ext_tree, hf_icmp_ext_checksum, tvb, offset + 2, 2, cksum, "Checksum: 0x%04x [incorrect, should be 0x%04x]", cksum, in_cksum_shouldbe(cksum, computed_cksum)); + hidden_item = + proto_tree_add_boolean(ext_tree, + hf_icmp_ext_checksum_bad, tvb, + offset + 2, 2, TRUE); } + PROTO_ITEM_SET_HIDDEN(hidden_item); if (version != 1 && version != 2) { /* Unsupported version */ @@ -1033,7 +1036,7 @@ static icmp_transaction_t *transaction_start(packet_info * pinfo, } if (!PINFO_FD_VISITED(pinfo)) { - /* this is a new request, create a new transaction structure and map it to the + /* this is a new request, create a new transaction structure and map it to the unmatched table */ icmp_key[0].length = 2; @@ -1362,12 +1365,12 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) 2, 2, cksum, "Checksum: 0x%04x [correct]", cksum); - } else { item = proto_tree_add_boolean(icmp_tree, hf_icmp_checksum_bad, - tvb, 2, 2, TRUE); + tvb, 2, 2, FALSE); PROTO_ITEM_SET_HIDDEN(item); + } else { proto_tree_add_uint_format(icmp_tree, hf_icmp_checksum, tvb, 2, 2, cksum, @@ -1375,6 +1378,11 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) cksum, in_cksum_shouldbe(cksum, computed_cksum)); + item = + proto_tree_add_boolean(icmp_tree, + hf_icmp_checksum_bad, + tvb, 2, 2, TRUE); + PROTO_ITEM_SET_HIDDEN(item); } } else { proto_tree_add_uint(icmp_tree, hf_icmp_checksum, tvb, 2, 2, |