Packets are *not* written in network byte order; the bytes of the packet
are written in the order in which they're received. The old comment saying that they're written in network byte order misled at least one person.
This commit is contained in:
parent
3e221afd71
commit
4321cb1b08
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.87 2003-08-18 22:16:13 guy Exp $ (LBL)";
|
"@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.88 2003-08-22 18:27:36 guy Exp $ (LBL)";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
|
@ -57,7 +57,10 @@ static const char rcsid[] =
|
||||||
* because time is at a premium when we are writing the file.
|
* because time is at a premium when we are writing the file.
|
||||||
* In other words, the pcap_file_header and pcap_pkthdr,
|
* In other words, the pcap_file_header and pcap_pkthdr,
|
||||||
* records are written in host byte order.
|
* records are written in host byte order.
|
||||||
* Note that the packets are always written in network byte order.
|
* Note that the bytes of packet data are written out in the order in
|
||||||
|
* which they were received, so multi-byte fields in packets are not
|
||||||
|
* written in host byte order, they're written in whatever order the
|
||||||
|
* sending machine put them in.
|
||||||
*
|
*
|
||||||
* ntoh[ls] aren't sufficient because we might need to swap on a big-endian
|
* ntoh[ls] aren't sufficient because we might need to swap on a big-endian
|
||||||
* machine (if the file was written in little-end order).
|
* machine (if the file was written in little-end order).
|
||||||
|
|
Reference in New Issue