aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/pppdump.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-17 22:22:42 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-17 22:22:42 +0000
commit2953cd1a97642fab1c75307ae6e10356da341ed2 (patch)
treedd358b92e90497566f786912b0aa87b8c11c7089 /wiretap/pppdump.c
parent1409de29e47943dc227ce900feab02164a661aee (diff)
From Irfan Khan: fix a couple of bugs in the pppdump reader.
svn path=/trunk/; revision=4414
Diffstat (limited to 'wiretap/pppdump.c')
-rw-r--r--wiretap/pppdump.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/pppdump.c b/wiretap/pppdump.c
index 1a90d6dbc3..8691c42717 100644
--- a/wiretap/pppdump.c
+++ b/wiretap/pppdump.c
@@ -1,6 +1,6 @@
/* pppdump.c
*
- * $Id: pppdump.c,v 1.12 2001/12/13 05:50:51 gram Exp $
+ * $Id: pppdump.c,v 1.13 2001/12/17 22:22:42 guy Exp $
*
* Copyright (c) 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
*
@@ -332,7 +332,7 @@ process_data(pppdump_t *state, FILE_T fh, pkt_t *pkt, int n, guint8 *pd, int *er
if (pkt->cnt > 0) {
pkt->esc = FALSE;
- num_written = pkt->cnt - 2;
+ num_written = pkt->cnt;
pkt->cnt = 0;
if (num_written <= 0) {
return 0;
@@ -471,17 +471,17 @@ collate(pppdump_t* state, FILE_T fh, int *err, guint8 *pd, int *num_bytes,
/* What can we do? */
break;
- case PPPD_TIME_STEP_LONG:
+ case PPPD_RESET_TIME:
wtap_file_read_unknown_bytes(&time_long, sizeof(guint32), fh, err);
state->offset += sizeof(guint32);
- state->timestamp = time_long;
+ state->timestamp = pntohl(&time_long);
state->tenths = 0;
break;
- case PPPD_RESET_TIME:
+ case PPPD_TIME_STEP_LONG:
wtap_file_read_unknown_bytes(&time_long, sizeof(guint32), fh, err);
state->offset += sizeof(guint32);
- state->tenths += time_long;
+ state->tenths += pntohl(&time_long);
if (state->tenths >= 10) {
state->timestamp += state->tenths / 10;