Ethereal-dev: Re: [ethereal-dev] File Save Error - DOS Sniffer Format

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Fri, 12 May 2000 14:37:45 -0700 (PDT)
> ie. rec_hdr.size = pletohs(&phdr->caplen)

Oops.

"phdr" is a "struct wtap_pkthdr *", and "caplen" in a "struct
wtap_pkthdr" is a "guint32", so it should be run through "pletohl()",
not "pletohs()".

The same applies to the "pletohs(&phdr->len)" on line 799.

Try replacing them with "pletohl()" (yes, the value may be assigned to a
16-bit quantity, but what matters is the size of the object passed *to*
the macro - the assignment will just throw away the upper 16 bits of the
host-byte-order result of "pletohl()", which are probably going to be
zero unless the packet is >65535 in which case it won't fit into a
Sniffer capture anyway).