aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/erf.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-01-12 19:05:15 -0800
committerGuy Harris <guy@alum.mit.edu>2016-01-13 03:06:06 +0000
commit42ca2a994d3720e4f396d9d64e4223c10b75d9e5 (patch)
treef030520f060028f0800e2328fbaab209d49d23c3 /wiretap/erf.c
parentfe1fd19db92dd5890a0c7df71a953e10aac4b4e5 (diff)
Use g_ntoh* rather than g_hton*.
Stuff in an ERF file is big-endian, except for timestamps, so we want to convert from big-endian to host format. (The two functions do the same thing; this just makes it clearer what we're doing.) Change-Id: I28e27857dcf299085e8a55747ffd45ad8313789b Reviewed-on: https://code.wireshark.org/review/13248 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/erf.c')
-rw-r--r--wiretap/erf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/erf.c b/wiretap/erf.c
index 088845bd6b..3d572e4881 100644
--- a/wiretap/erf.c
+++ b/wiretap/erf.c
@@ -453,7 +453,7 @@ static gboolean erf_read_header(FILE_T fh,
*bytes_read += (guint32)sizeof(eth_hdr);
*packet_size -= (guint32)sizeof(eth_hdr);
skiplen += (guint32)sizeof(eth_hdr);
- pseudo_header->erf.subhdr.eth_hdr = g_htons(eth_hdr);
+ pseudo_header->erf.subhdr.eth_hdr = g_ntohs(eth_hdr);
break;
case ERF_TYPE_MC_HDLC:
@@ -470,7 +470,7 @@ static gboolean erf_read_header(FILE_T fh,
*bytes_read += (guint32)sizeof(mc_hdr);
*packet_size -= (guint32)sizeof(mc_hdr);
skiplen += (guint32)sizeof(mc_hdr);
- pseudo_header->erf.subhdr.mc_hdr = g_htonl(mc_hdr);
+ pseudo_header->erf.subhdr.mc_hdr = g_ntohl(mc_hdr);
break;
case ERF_TYPE_IP_COUNTER:
@@ -484,9 +484,9 @@ static gboolean erf_read_header(FILE_T fh,
}
{
- phdr->len = g_htons(erf_header->wlen);
- phdr->caplen = MIN( g_htons(erf_header->wlen),
- g_htons(erf_header->rlen) - (guint32)sizeof(*erf_header) - skiplen );
+ phdr->len = g_ntohs(erf_header->wlen);
+ phdr->caplen = MIN( g_ntohs(erf_header->wlen),
+ g_ntohs(erf_header->rlen) - (guint32)sizeof(*erf_header) - skiplen );
}
if (*packet_size > WTAP_MAX_PACKET_SIZE) {