From Marcus Renz: Fix for "PTP dissector displays big correction field values wrong"
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 16 Apr 2010 19:27:56 +0000 (19:27 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 16 Apr 2010 19:27:56 +0000 (19:27 +0000)
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

AUTHORS
epan/dissectors/packet-ptp.c

diff --git a/AUTHORS b/AUTHORS
index 1c4c2c642d7e63a73d9a90bba485ac07db7bb351..99f637b7ed4438fef5f7bd1d3d312a33ab5e81e2 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -3196,6 +3196,7 @@ Hilko Bengen              <bengen--wireshark [AT] hilluzination.de>
 Hadar Shoham           <hadar [AT] ti.com>
 Robert Bullen          <robert [AT] bitcricket.com>
 Chuck Kristofek                <chuck.kristofek [AT] ngc.com>
+Markus Renz            <Markus.Renz [AT] hirschmann.de>
 
 Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
 give his permission to use his version of snprintf.c.
index b355c63cef16d85be254fd87c071482849ea00c2..149ed45ff6dac566f621af004fde17082dd13aa3 100644 (file)
@@ -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);