Kill some gratuitous byte-swapping calls, which broke rbootd on the i386
in some cases. No functional change on big-endian systems. From Scott Reynolds <scottr@plexus.com>.
This commit is contained in:
parent
83604dcbd6
commit
507ba8247c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bpf.c,v 1.5 1995/10/06 05:12:12 thorpej Exp $ */
|
||||
/* $NetBSD: bpf.c,v 1.6 1995/11/14 08:41:42 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1992 The University of Utah and the Center
|
||||
|
@ -48,7 +48,7 @@
|
|||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "@(#)bpf.c 8.1 (Berkeley) 6/4/93";*/
|
||||
static char rcsid[] = "$NetBSD: bpf.c,v 1.5 1995/10/06 05:12:12 thorpej Exp $";
|
||||
static char rcsid[] = "$NetBSD: bpf.c,v 1.6 1995/11/14 08:41:42 thorpej Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -350,7 +350,7 @@ BpfRead(rconn, doread)
|
|||
syslog(LOG_ERR, "bpf: large packet dropped (%d bytes)",
|
||||
caplen);
|
||||
else {
|
||||
rconn->rmplen = htons(caplen);
|
||||
rconn->rmplen = caplen;
|
||||
bcopy((char *)&bhp->bh_tstamp, (char *)&rconn->tstamp,
|
||||
sizeof(struct timeval));
|
||||
bcopy((char *)bp + hdrlen, (char *)&rconn->rmp, caplen);
|
||||
|
@ -379,7 +379,7 @@ int
|
|||
BpfWrite(rconn)
|
||||
RMPCONN *rconn;
|
||||
{
|
||||
if (write(BpfFd, (char *)&rconn->rmp, ntohs(rconn->rmplen)) < 0) {
|
||||
if (write(BpfFd, (char *)&rconn->rmp, rconn->rmplen) < 0) {
|
||||
syslog(LOG_ERR, "write: %s: %m", EnetStr(rconn));
|
||||
return(0);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rmp_var.h,v 1.7 1995/10/06 05:12:19 thorpej Exp $ */
|
||||
/* $NetBSD: rmp_var.h,v 1.8 1995/11/14 08:41:44 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1992 The University of Utah and the Center
|
||||
|
@ -98,12 +98,12 @@
|
|||
* limited to 255 bytes due to the preceding 1-byte length field.
|
||||
*/
|
||||
|
||||
#define RMPBOOTSIZE(s) htons(sizeof(struct hp_hdr) + sizeof(struct hp_llc) + \
|
||||
#define RMPBOOTSIZE(s) (sizeof(struct hp_hdr) + sizeof(struct hp_llc) + \
|
||||
sizeof(struct rmp_boot_repl) + s - sizeof(restofpkt))
|
||||
#define RMPREADSIZE(s) htons(sizeof(struct hp_hdr) + sizeof(struct hp_llc) + \
|
||||
#define RMPREADSIZE(s) (sizeof(struct hp_hdr) + sizeof(struct hp_llc) + \
|
||||
sizeof(struct rmp_read_repl) + s - sizeof(restofpkt) \
|
||||
- sizeof(u_int8_t))
|
||||
#define RMPDONESIZE htons(sizeof(struct hp_hdr) + sizeof(struct hp_llc) + \
|
||||
#define RMPDONESIZE (sizeof(struct hp_hdr) + sizeof(struct hp_llc) + \
|
||||
sizeof(struct rmp_boot_done))
|
||||
#define RMPBOOTDATA 255
|
||||
#define RMPREADDATA (RMPDATALEN - \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rmpproto.c,v 1.5 1995/10/06 05:12:21 thorpej Exp $ */
|
||||
/* $NetBSD: rmpproto.c,v 1.6 1995/11/14 08:41:46 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1992 The University of Utah and the Center
|
||||
|
@ -48,7 +48,7 @@
|
|||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "@(#)rmpproto.c 8.1 (Berkeley) 6/4/93";*/
|
||||
static char rcsid[] = "$NetBSD: rmpproto.c,v 1.5 1995/10/06 05:12:21 thorpej Exp $";
|
||||
static char rcsid[] = "$NetBSD: rmpproto.c,v 1.6 1995/11/14 08:41:46 thorpej Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -574,8 +574,7 @@ SendPacket(rconn)
|
|||
*/
|
||||
bcopy((char *)&rconn->rmp.hp_hdr.saddr[0],
|
||||
(char *)&rconn->rmp.hp_hdr.daddr[0], RMP_ADDRLEN);
|
||||
rconn->rmp.hp_hdr.len = htons(ntohs(rconn->rmplen)
|
||||
- sizeof(struct hp_hdr));
|
||||
rconn->rmp.hp_hdr.len = htons(rconn->rmplen - sizeof(struct hp_hdr));
|
||||
|
||||
/*
|
||||
* Reverse 802.2/HP Extended Source & Destination Access Pts.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: utils.c,v 1.5 1995/10/06 05:12:22 thorpej Exp $ */
|
||||
/* $NetBSD: utils.c,v 1.6 1995/11/14 08:41:47 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1992 The University of Utah and the Center
|
||||
|
@ -48,7 +48,7 @@
|
|||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "@(#)utils.c 8.1 (Berkeley) 6/4/93";*/
|
||||
static char rcsid[] = "$NetBSD: utils.c,v 1.5 1995/10/06 05:12:22 thorpej Exp $";
|
||||
static char rcsid[] = "$NetBSD: utils.c,v 1.6 1995/11/14 08:41:47 thorpej Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -166,7 +166,7 @@ DispPkt(rconn, direct)
|
|||
(void) fprintf(DbgFp, ReadFmt, rmp->r_rrpl.rmp_retcode,
|
||||
t, ntohs(rmp->r_rrpl.rmp_session));
|
||||
(void) fprintf(DbgFp, "\t\tNoOfBytesSent: %d\n",
|
||||
ntohs(rconn->rmplen) - ntohs(RMPREADSIZE(0)));
|
||||
rconn->rmplen - RMPREADSIZE(0));
|
||||
break;
|
||||
case RMP_BOOT_DONE: /* boot complete */
|
||||
(void) fprintf(DbgFp, "\tBoot Complete:\n");
|
||||
|
|
Loading…
Reference in New Issue