diff options
| author | mycroft <mycroft@NetBSD.org> | 1995-02-21 10:14:53 +0000 |
|---|---|---|
| committer | mycroft <mycroft@NetBSD.org> | 1995-02-21 10:14:53 +0000 |
| commit | 3757efcbfc990f7b01eafd9d20aceba7e5ddedd8 (patch) | |
| tree | e33aaa642539f3c43c3f4eca78917cba659ded12 /sys/lib/libsa | |
| parent | 715c38c819c30aa870cf2a32c14b7d1dbba44c3d (diff) | |
Clean up a little.
Diffstat (limited to 'sys/lib/libsa')
| -rw-r--r-- | sys/lib/libsa/bootp.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/lib/libsa/bootp.c b/sys/lib/libsa/bootp.c index eb02c1142ce..2c55869641e 100644 --- a/sys/lib/libsa/bootp.c +++ b/sys/lib/libsa/bootp.c @@ -1,4 +1,4 @@ -/* $NetBSD: bootp.c,v 1.3 1995/02/20 11:04:04 mycroft Exp $ */ +/* $NetBSD: bootp.c,v 1.4 1995/02/21 10:14:53 mycroft Exp $ */ /* * Copyright (c) 1992 Regents of the University of California. @@ -94,15 +94,18 @@ bootp(sock) if (debug) printf("bootp: d=%x\n", (u_int)d); #endif + bp = &wbuf.wbootp; bzero(bp, sizeof(*bp)); bp->bp_op = BOOTREQUEST; bp->bp_htype = 1; /* 10Mb Ethernet (48 bits) */ bp->bp_hlen = 6; + bp->bp_xid = d->xid; MACPY(d->myea, bp->bp_chaddr); + bzero(bp->bp_file, sizeof(bp->bp_file)); + bcopy(vm_rfc1048, bp->bp_vend, sizeof(vm_rfc1048)); - d->xid = 0; d->myip = myip; d->myport = IPPORT_BOOTPC; d->destip = INADDR_BROADCAST; @@ -111,6 +114,9 @@ bootp(sock) (void)sendrecv(d, bootpsend, bp, sizeof(*bp), bootprecv, &rbuf.rbootp, sizeof(rbuf.rbootp)); + + /* Bump xid so next request will be unique. */ + ++d->xid; } /* Transmit a bootp request */ @@ -128,10 +134,6 @@ bootpsend(d, pkt, len) #endif bp = pkt; - bzero(bp->bp_file, sizeof(bp->bp_file)); - - bcopy(vm_rfc1048, bp->bp_vend, sizeof(long)); - bp->bp_xid = d->xid; bp->bp_secs = (u_long)(getsecs() - bot); #ifdef BOOTP_DEBUG @@ -179,9 +181,6 @@ bootprecv(d, pkt, len, tleft) goto bad; } - /* Bump xid so next request will be unique. */ - ++d->xid; - #ifdef BOOTP_DEBUG if (debug) printf("bootprecv: got one!\n"); |
