diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2011-03-14 19:58:02 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2011-03-14 19:58:02 +0000 |
commit | 1fc46d7c4dcf98eb549829ad13b4f15fc6188b0a (patch) | |
tree | ce3bab7cc8731b161a4ef8e586d13884811519c7 /epan/dissectors/packet-icmp.c | |
parent | 670d38ec71a5930e066fc08ee3b4d3e08111ddfe (diff) | |
download | wireshark-1fc46d7c4dcf98eb549829ad13b4f15fc6188b0a.tar.gz |
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
Diffstat (limited to 'epan/dissectors/packet-icmp.c')
-rw-r--r-- | epan/dissectors/packet-icmp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index 105550a5b1..89950e9100 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -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); |