From 3ef7e4f20dff49f65e3f53c83a51531b6f51f0aa Mon Sep 17 00:00:00 2001 From: wmeier Date: Fri, 16 Apr 2010 19:27:56 +0000 Subject: From Marcus Renz: Fix for "PTP dissector displays big correction field values wrong" See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4635 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32499 f5534014-38df-0310-8fa8-9805f1628bb7 --- epan/dissectors/packet-ptp.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'epan/dissectors/packet-ptp.c') diff --git a/epan/dissectors/packet-ptp.c b/epan/dissectors/packet-ptp.c index b355c63cef..149ed45ff6 100644 --- a/epan/dissectors/packet-ptp.c +++ b/epan/dissectors/packet-ptp.c @@ -2172,24 +2172,11 @@ dissect_ptp_v2_timeInterval(tvbuff_t *tvb, guint16 *cur_offset, proto_tree *tree proto_item *ptptimeInterval_ti; proto_tree *ptptimeInterval_subtree; - time_ns = tvb_get_ntohl(tvb, *cur_offset); - + time_ns = tvb_get_ntoh64(tvb, *cur_offset); + time_double = (1.0*time_ns) / 65536.0; + time_ns = time_ns >> 16; time_subns = tvb_get_ntohs(tvb, *cur_offset+6); - time_ns = time_ns << 16; - - if(time_ns & 0x800000){ - time_ns = time_ns | G_GINT64_CONSTANT(0xFFFFFFFFFF000000); - time_ns = time_ns | tvb_get_ntohs(tvb, *cur_offset+4); - - time_double = ((1.0*time_ns) + (time_subns/65536.0)); - } - else - { - time_ns = time_ns | tvb_get_ntohs(tvb, *cur_offset+4); - time_double = time_ns + (time_subns/65536.0); - } - ptptimeInterval_ti = proto_tree_add_text(tree, tvb, *cur_offset, 8, "%s: %f nanoseconds", name, time_double); -- cgit v1.2.3