Don't verify the checksum of an ICMP packet when it the payload of an
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 14 Mar 2011 19:58:02 +0000 (19:58 +0000)
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 14 Mar 2011 19:58:02 +0000 (19:58 +0000)
error packet (pinfo->in_error_pkt), such as an ICMP destination
unreachable, because we probably don't have the whole original packet.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36193 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-icmp.c

index 105550a5b121d3139baf6354877e8c0b27c7db58..89950e910095bfdc5a7ef2c1b646a7c2002cb14c 100644 (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);