diff --git a/usr.sbin/rbootd/bpf.c b/usr.sbin/rbootd/bpf.c index fcb06445bc9f..3fc5423127dd 100644 --- a/usr.sbin/rbootd/bpf.c +++ b/usr.sbin/rbootd/bpf.c @@ -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 @@ -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); } diff --git a/usr.sbin/rbootd/rmp_var.h b/usr.sbin/rbootd/rmp_var.h index f00d90583cc9..c60b6ddf3637 100644 --- a/usr.sbin/rbootd/rmp_var.h +++ b/usr.sbin/rbootd/rmp_var.h @@ -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 - \ diff --git a/usr.sbin/rbootd/rmpproto.c b/usr.sbin/rbootd/rmpproto.c index d752ac0e9aab..19be935b1cec 100644 --- a/usr.sbin/rbootd/rmpproto.c +++ b/usr.sbin/rbootd/rmpproto.c @@ -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 @@ -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. diff --git a/usr.sbin/rbootd/utils.c b/usr.sbin/rbootd/utils.c index 5f891613d8af..5d37a25bd9ea 100644 --- a/usr.sbin/rbootd/utils.c +++ b/usr.sbin/rbootd/utils.c @@ -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 @@ -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");