aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2006-10-20 01:17:17 +0000
committerBill Meier <wmeier@newsguy.com>2006-10-20 01:17:17 +0000
commit798a4b8c77f92134c8100d522554037d5dd0828e (patch)
tree2de3092abd5060f7eec7c3bb775e586256969dc9 /wiretap
parent2f053534b1347b00fc0425f3532105b30da9d679 (diff)
fix 'save' to store hi-order 32 bits of time offset for each pkt; fixes bug 1168
svn path=/trunk/; revision=19622
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/netxray.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/wiretap/netxray.c b/wiretap/netxray.c
index fa5207dea1..24c9c42645 100644
--- a/wiretap/netxray.c
+++ b/wiretap/netxray.c
@@ -1441,7 +1441,8 @@ static gboolean netxray_dump_1_1(wtap_dumper *wdh,
const guchar *pd, int *err)
{
netxray_dump_t *netxray = wdh->dump.netxray;
- guint32 timestamp;
+ guint64 timestamp;
+ guint32 t32;
struct netxrayrec_1_x_hdr rec_hdr;
size_t nwritten;
@@ -1462,10 +1463,12 @@ static gboolean netxray_dump_1_1(wtap_dumper *wdh,
/* build the header for each packet */
memset(&rec_hdr, '\0', sizeof(rec_hdr));
- timestamp = (phdr->ts.secs - netxray->start.secs)*1000000 +
- phdr->ts.nsecs / 1000;
- rec_hdr.timelo = htolel(timestamp);
- rec_hdr.timehi = htolel(0);
+ timestamp = ((guint64)phdr->ts.secs - (guint64)netxray->start.secs)*1000000
+ + ((guint64)phdr->ts.nsecs)/1000;
+ t32 = (guint32)(timestamp%4294967296);
+ rec_hdr.timelo = htolel(t32);
+ t32 = (guint32)(timestamp/4294967296);
+ rec_hdr.timehi = htolel(t32);
rec_hdr.orig_len = htoles(phdr->len);
rec_hdr.incl_len = htoles(phdr->caplen);
@@ -1630,7 +1633,8 @@ static gboolean netxray_dump_2_0(wtap_dumper *wdh,
const guchar *pd, int *err)
{
netxray_dump_t *netxray = wdh->dump.netxray;
- guint32 timestamp;
+ guint64 timestamp;
+ guint32 t32;
struct netxrayrec_2_x_hdr rec_hdr;
size_t nwritten;
@@ -1651,10 +1655,12 @@ static gboolean netxray_dump_2_0(wtap_dumper *wdh,
/* build the header for each packet */
memset(&rec_hdr, '\0', sizeof(rec_hdr));
- timestamp = (phdr->ts.secs - netxray->start.secs)*1000000 +
- phdr->ts.nsecs/1000;
- rec_hdr.timelo = htolel(timestamp);
- rec_hdr.timehi = htolel(0);
+ timestamp = ((guint64)phdr->ts.secs - (guint64)netxray->start.secs)*1000000
+ + ((guint64)phdr->ts.nsecs)/1000;
+ t32 = (guint32)(timestamp%4294967296);
+ rec_hdr.timelo = htolel(t32);
+ t32 = (guint32)(timestamp/4294967296);
+ rec_hdr.timehi = htolel(t32);
rec_hdr.orig_len = htoles(phdr->len);
rec_hdr.incl_len = htoles(phdr->caplen);