diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2012-09-19 17:57:54 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2012-09-19 17:57:54 +0000 |
commit | 86db174948ce84b954c688f9fe6a895d4e512383 (patch) | |
tree | 8820900e7e5472281051848180e1c665b446445c /epan | |
parent | d729f21ad293e7cf5bd295318b564853a7330f7f (diff) |
Fix request/response tracking with checksum corner case.
svn path=/trunk/; revision=45007
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-icmp.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-icmpv6.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index 000c090c41..d9b9bcd146 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -1358,6 +1358,8 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tmp[0] = ~tvb_get_ntohs(tvb, 2); tmp[1] = ~0x0800; /* The difference between echo request & reply */ conv_key[0] = ip_checksum((guint8 *)&tmp, sizeof(tmp)); + if (conv_key[0] == 0) + conv_key[0] = 0xffff; if (pinfo->flags.in_gre_pkt) conv_key[0] |= 0x00010000; /* set a bit for "in GRE" */ conv_key[1] = (guint32)((tvb_get_ntohs(tvb, 4) << 16) | diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index d7d2d6bd06..40c8437593 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -2062,7 +2062,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree guint8 context_id; guint8 context_len; struct e_in6_addr context_prefix; - + /* Context Length */ proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_context_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN); context_len = tvb_get_guint8(tvb, opt_offset); @@ -2084,7 +2084,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree /* Lifetime */ proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_valid_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN); opt_offset += 2; - + /* Context */ memset(&context_prefix.bytes, 0, sizeof(context_prefix)); switch(opt_len){ @@ -3285,6 +3285,8 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ cksum_vec[0].len = sizeof(tmp); cksum_vec[0].ptr = (guint8 *)tmp; conv_key[0] = in_cksum(cksum_vec, 1); + if (conv_key[0] == 0) + conv_key[0] = 0xffff; if (pinfo->flags.in_gre_pkt) conv_key[0] |= 0x00010000; /* set a bit for "in GRE" */ trans = transaction_end(pinfo, icmp6_tree, conv_key); |