aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-10-30 11:53:48 +0000
committerGuy Harris <guy@alum.mit.edu>2003-10-30 11:53:48 +0000
commit305afc4e9776a012386496d3b186aa072fdce519 (patch)
tree668410b9e9840af314cf62930a0632ddcc22a898 /wiretap
parent611c97136414c61a9fa318c4116c9b8c556a790c (diff)
The quantities in the hcidump header are little-endian, not big-endian.
svn path=/trunk/; revision=8831
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/hcidump.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/hcidump.c b/wiretap/hcidump.c
index f61c092c82..9d79792fbd 100644
--- a/wiretap/hcidump.c
+++ b/wiretap/hcidump.c
@@ -1,6 +1,6 @@
/* hcidump.c
*
- * $Id: hcidump.c,v 1.1 2003/10/30 03:11:02 guy Exp $
+ * $Id: hcidump.c,v 1.2 2003/10/30 11:53:48 guy Exp $
*
* Copyright (c) 2003 by Marcel Holtmann <marcel@holtmann.org>
*
@@ -55,7 +55,7 @@ static gboolean hcidump_read(wtap *wth, int *err, long *data_offset)
}
wth->data_offset += DUMP_HDR_SIZE;
- packet_size = g_ntohs(dh.len);
+ packet_size = GUINT16_FROM_LE(dh.len);
if (packet_size > WTAP_MAX_PACKET_SIZE) {
/*
* Probably a corrupt capture file; don't blow up trying
@@ -79,8 +79,8 @@ static gboolean hcidump_read(wtap *wth, int *err, long *data_offset)
}
wth->data_offset += packet_size;
- wth->phdr.ts.tv_sec = g_ntohl(dh.ts_sec);
- wth->phdr.ts.tv_usec = g_ntohl(dh.ts_usec);
+ wth->phdr.ts.tv_sec = GUINT32_FROM_LE(dh.ts_sec);
+ wth->phdr.ts.tv_usec = GUINT32_FROM_LE(dh.ts_usec);
wth->phdr.caplen = packet_size;
wth->phdr.len = packet_size;
wth->phdr.pkt_encap = WTAP_ENCAP_BLUETOOTH_H4;
@@ -131,7 +131,7 @@ int hcidump_open(wtap *wth, int *err)
return (*err != 0) ? -1 : 0;
}
- if (dh.in != 0 && dh.in != 1 && dh.pad != 0 && g_ntohs(dh.len) < 1)
+ if (dh.in != 0 && dh.in != 1 && dh.pad != 0 && GUINT16_FROM_LE(dh.len) < 1)
return 0;
bytes_read = file_read(&type, 1, 1, wth->fh);