diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2014-10-31 14:16:11 -0400 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-11-01 15:51:58 +0000 |
commit | 74e8613fe17a7588040aedc2d806d3bace75e6ee (patch) | |
tree | 8f4771fe5257a5e9c09b52b57ea823de40f47a44 /epan/dissectors/packet-icmpv6.c | |
parent | 6a3736873831f0fd766f5a482ae01f72a4a3dc49 (diff) |
Don't check the checksum if we're encapsulated in an (ICMP) error packet.
This is the case when an ICMP echo is returned (e.g., because it's too big).
This effectively applies SVN rev 36193 to ICMPv6.
Bug: 10620
Change-Id: I29aeaabc2467c818714df448e39b3a93027c8961
Reviewed-on: https://code.wireshark.org/review/5030
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-icmpv6.c')
-rw-r--r-- | epan/dissectors/packet-icmpv6.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index 2ace022bc2..2c23018979 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -3283,9 +3283,10 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) if (1) { /* There's an expert info in here so always execute */ length = tvb_captured_length(tvb); reported_length = tvb_reported_length(tvb); - 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->flags.in_error_pkt) { + /* The packet isn't part of a fragmented datagram, isn't truncated, + * and we aren't in an ICMP error packet, so we can checksum it. + */ /* Set up the fields of the pseudo-header. */ SET_CKSUM_VEC_PTR(cksum_vec[0], (const guint8 *)pinfo->src.data, pinfo->src.len); @@ -3307,6 +3308,9 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) expert_add_info_format(pinfo, checksum_item, &ei_icmpv6_checksum, "ICMPv6 Checksum Incorrect, should be 0x%04x", in_cksum_shouldbe(cksum, computed_cksum)); } + } else { + proto_item_append_text(checksum_item, " [%s]", + pinfo->flags.in_error_pkt ? "in ICMP error packet" : "fragmented datagram"); } } offset += 2; |