diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-12-15 04:20:46 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-12-15 04:20:46 +0000 |
commit | 233f6e5846f634f4e3ab2cc36864ab87c77b208f (patch) | |
tree | ffccdc14ed971bfd302c7ba0ac70330a5763c9dc /packet-ncp.c | |
parent | 9658c33db60e0185272c6ab30879b79da9cf69a0 (diff) |
Small change to header processing from James Coe:
The attached patch changes the NCP over IP header processing to
use element = pntohl(&pd[offset]) instead of memcopy since the
byte order of every element had to be fixed anyway and the
header is small.
svn path=/trunk/; revision=1339
Diffstat (limited to 'packet-ncp.c')
-rw-r--r-- | packet-ncp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packet-ncp.c b/packet-ncp.c index ed1cff36aa..8ad91e5cb1 100644 --- a/packet-ncp.c +++ b/packet-ncp.c @@ -3,7 +3,7 @@ * Gilbert Ramirez <gram@verdict.uthscsa.edu> * Modified to allow NCP over TCP/IP decodes by James Coe <jammer@cin.net> * - * $Id: packet-ncp.c,v 1.26 1999/12/14 21:57:03 nneul Exp $ + * $Id: packet-ncp.c,v 1.27 1999/12/15 04:20:46 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -548,16 +548,16 @@ dissect_ncp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { struct ncp_common_header header; if ( pi.ptype == PT_TCP || pi.ptype == PT_UDP ) { - memcpy(&ncpiph, &pd[offset], sizeof(ncpiph)); - ncpiph.signature = ntohl(ncpiph.signature); - ncpiph.length = ntohl(ncpiph.length); + ncpiph.signature = pntohl(&pd[offset]); + ncpiph.length = pntohl(&pd[offset + 4]); offset += 8; if ( ncpiph.signature == NCPIP_RQST ) { - memcpy(&ncpiphrq, &pd[offset], sizeof(ncpiphrq)); - ncpiphrq.rplybufsize = ntohl(ncpiphrq.rplybufsize); + ncpiphrq.version = pntohl(&pd[offset]); + ncpiphrq.rplybufsize = pntohl(&pd[offset + 4]); offset += 8; }; }; + memcpy(&header, &pd[offset], sizeof(header)); header.type = ntohs(header.type); |