aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ptp.c
diff options
context:
space:
mode:
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>2010-04-16 19:27:56 +0000
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>2010-04-16 19:27:56 +0000
commit3ef7e4f20dff49f65e3f53c83a51531b6f51f0aa (patch)
tree57fbf57b3c40472b38830906492ed0eb7cf26ac2 /epan/dissectors/packet-ptp.c
parent235aac74fc51ddd7cbdf906e5a2d04d885910f8e (diff)
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
Diffstat (limited to 'epan/dissectors/packet-ptp.c')
-rw-r--r--epan/dissectors/packet-ptp.c19
1 files changed, 3 insertions, 16 deletions
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);