aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ip.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-03-24 00:39:44 +0000
committerGuy Harris <guy@alum.mit.edu>2013-03-24 00:39:44 +0000
commitfc5b86f6d4f5eb000f91371959aeddbb534e7929 (patch)
treec5983cf0d69597c04536915b7512d255deeb2dd0 /epan/dissectors/packet-ip.c
parent4ba4e1df703fd1c7c6b83f8cb3f53a886ac49931 (diff)
Correctly label checksums not checked due to the packet in question
being incorporated inside an ICMP error packet. svn path=/trunk/; revision=48518
Diffstat (limited to 'epan/dissectors/packet-ip.c')
-rw-r--r--epan/dissectors/packet-ip.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index 0032133070..5dcd28b033 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -2133,7 +2133,9 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
iph->ip_sum = tvb_get_ntohs(tvb, offset + 10);
/*
- * If we have the entire IP header available, check the checksum.
+ * If checksum checking is enabled, and we have the entire IP header
+ * available, and this isn't inside an ICMP error packet, check the
+ * checksum.
*/
if (ip_check_checksum && tvb_bytes_exist(tvb, offset, hlen)&&(!pinfo->flags.in_error_pkt)) {
ipsum = ip_checksum(tvb_get_ptr(tvb, offset, hlen), hlen);
@@ -2182,9 +2184,12 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
item = proto_tree_add_uint_format(ip_tree, hf_ip_checksum, tvb,
offset + 10, 2, iph->ip_sum,
"Header checksum: 0x%04x [%s]",
- iph->ip_sum, ip_check_checksum ?
- "not all data available" :
- "validation disabled");
+ iph->ip_sum,
+ ip_check_checksum ?
+ (pinfo->flags.in_error_pkt ?
+ "in ICMP error packet" :
+ "not all data available") :
+ "validation disabled");
checksum_tree = proto_item_add_subtree(item, ett_ip_checksum);
item = proto_tree_add_boolean(checksum_tree, hf_ip_checksum_good, tvb,
offset + 10, 2, FALSE);