Don't verify the checksum of an ICMP packet when it the payload of an

error packet (pinfo->in_error_pkt), such as an ICMP destination
unreachable, because we probably don't have the whole original packet.


svn path=/trunk/; revision=36193
This commit is contained in:
Stephen Fisher 2011-03-14 19:58:02 +00:00
parent 670d38ec71
commit 1fc46d7c4d
1 changed files with 4 additions and 3 deletions

View File

@ -752,9 +752,10 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (code_str)
proto_item_append_text (ti, " (%s)", code_str);
if (!pinfo->fragmented && length >= reported_length) {
/* The packet isn't part of a fragmented datagram and isn't
truncated, so we can checksum it. */
if (!pinfo->fragmented && length >= reported_length && !pinfo->in_error_pkt) {
/* The packet isn't part of a fragmented datagram, isn't
truncated, and isn't the payload of an error packet, so we can checksum
it. */
computed_cksum = ip_checksum(tvb_get_ptr(tvb, 0, reported_length),
reported_length);