aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-icmp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c
index e6350b8c18..7f59b9917b 100644
--- a/epan/dissectors/packet-icmp.c
+++ b/epan/dissectors/packet-icmp.c
@@ -777,7 +777,7 @@ dissect_extensions(tvbuff_t * tvb, packet_info *pinfo, gint offset, proto_tree *
guint8 version;
guint8 class_num;
guint8 c_type;
- guint16 obj_length, obj_trunc_length;
+ guint16 obj_length, obj_trunc_length, checksum;
proto_item *ti, *tf_object;
proto_tree *ext_tree, *ext_object_tree;
gint obj_end_offset;
@@ -810,8 +810,15 @@ dissect_extensions(tvbuff_t * tvb, packet_info *pinfo, gint offset, proto_tree *
tvb, offset, 2, ENC_BIG_ENDIAN);
/* Checksum */
+ checksum = tvb_get_ntohs(tvb, offset + 2);
+ if (checksum == 0) {
+ proto_tree_add_checksum(ext_tree, tvb, offset + 2, hf_icmp_ext_checksum, hf_icmp_ext_checksum_status, &ei_icmp_ext_checksum,
+ pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NOT_PRESENT);
+
+ } else {
proto_tree_add_checksum(ext_tree, tvb, offset + 2, hf_icmp_ext_checksum, hf_icmp_ext_checksum_status, &ei_icmp_ext_checksum,
- pinfo, ip_checksum_tvb(tvb, 0, reported_length), ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY|PROTO_CHECKSUM_IN_CKSUM);
+ pinfo, ip_checksum_tvb(tvb, offset, reported_length), ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY|PROTO_CHECKSUM_IN_CKSUM);
+ }
if (version != 1 && version != 2) {
/* Unsupported version */