diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2012-07-05 20:07:43 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2012-07-05 20:07:43 +0000 |
commit | a9b2a718a78fa93ac80e1af46e90f91d8f1ff5b1 (patch) | |
tree | 54262eaa6c7af93e986557bd75b4707d14fc5685 | |
parent | efe4dd96aaf3ded2b53b84f78c6602b8c11045d4 (diff) |
Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7437 :
PTP Cancel unicast transmission and Acknowledge cancel unicast transmission packets are decoded as malformed
svn path=/trunk/; revision=43575
-rw-r--r-- | epan/dissectors/packet-ptp.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/epan/dissectors/packet-ptp.c b/epan/dissectors/packet-ptp.c index 82a01a2ad8..51482c1a7e 100644 --- a/epan/dissectors/packet-ptp.c +++ b/epan/dissectors/packet-ptp.c @@ -2865,11 +2865,9 @@ dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_tlvType, tvb, PTP_V2_SIG_TARGETPORTID_OFFSET+2, 2, ENC_BIG_ENDIAN); - proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_lengthField, tvb, - PTP_V2_SIG_TARGETPORTID_OFFSET+4, 2, ENC_BIG_ENDIAN); - - /*tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);*/ - tlv_length = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_LENGTHFIELD_OFFSET); + tlv_length = tvb_get_ntohs(tvb, PTP_V2_SIG_TARGETPORTID_OFFSET+4); + proto_tree_add_uint(ptp_tree, hf_ptp_v2_mm_lengthField, tvb, + PTP_V2_SIG_TARGETPORTID_OFFSET+4, 2, tlv_length); if (tlv_length <= 2) { @@ -2877,7 +2875,8 @@ dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; } /* ToDO: Add dissector for TLVs and allow multiple TLVs */ - proto_tree_add_text(ptp_tree, tvb, PTP_V2_SIG_TARGETPORTID_OFFSET+6, tlv_length, "Data"); + proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_data, tvb, + PTP_V2_SIG_TARGETPORTID_OFFSET+6, tlv_length, ENC_NA); } break; } @@ -2929,7 +2928,7 @@ dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; } - managementData_ti = proto_tree_add_text(ptp_tree, tvb, Offset, tlv_length, "Data"); + managementData_ti = proto_tree_add_item(ptp_tree, hf_ptp_v2_mm_data, tvb, Offset, tlv_length, ENC_NA); /* data field of the management message (subtree)*/ ptp_managementData_tree = proto_item_add_subtree(managementData_ti, ett_ptp_v2_managementData); |