summaryrefslogtreecommitdiff
path: root/os/boot/pc/bootp.c
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2008-06-11 14:21:44 +0000
committerCharles.Forsyth <devnull@localhost>2008-06-11 14:21:44 +0000
commit8a8c2d742b51525f66c2210e3c8a251de10022ff (patch)
tree8282ce595e5fbe2e487dc20f54891d9e9e7cbf37 /os/boot/pc/bootp.c
parent31a18a6996a6b5927e39cc553696c167e6c88e3d (diff)
20080611-1520
Diffstat (limited to 'os/boot/pc/bootp.c')
-rw-r--r--os/boot/pc/bootp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/os/boot/pc/bootp.c b/os/boot/pc/bootp.c
index 64df7e14..92caadf2 100644
--- a/os/boot/pc/bootp.c
+++ b/os/boot/pc/bootp.c
@@ -7,6 +7,8 @@
#include "ip.h"
+extern int debugload;
+
uchar broadcast[Eaddrlen] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
@@ -292,15 +294,15 @@ udprecv(int ctlrno, Netaddr *a, void *data, int dlen)
if(a->port != 0 && nhgets(h->udpsport) != a->port) {
if(debug)
- print("udpport %ux %ux\n",
+ print("udpport %ux not %ux\n",
nhgets(h->udpsport), a->port);
continue;
}
addr = nhgetl(h->udpsrc);
- if(a->ip != Bcastip && addr != a->ip) {
+ if(a->ip != Bcastip && a->ip != addr) {
if(debug)
- print("bad ip\n");
+ print("bad ip %lux not %lux\n", addr, a->ip);
continue;
}
@@ -441,6 +443,8 @@ bootpopen(int ctlrno, char *file, Bootp *rep, int dotftpopen)
uchar *ea;
char name[128], *filename, *sysname;
+ if (debugload)
+ print("bootpopen: ether%d!%s...", ctlrno, file);
if((ea = etheraddr(ctlrno)) == 0){
print("invalid ctlrno %d\n", ctlrno);
return -1;
@@ -620,7 +624,8 @@ pxewalk(File* f, char* name)
return 0;
ini = pxether[f->fs->dev].ini;
- snprint(ini, INIPATHLEN, "/cfg/pxe/%E", rep.chaddr);
+ /* use our mac address instead of relying on a bootp answer */
+ snprint(ini, INIPATHLEN, "/cfg/pxe/%E", (uchar *)myaddr.ea);
f->path = ini;
return 1;
@@ -637,6 +642,8 @@ pxegetfspart(int ctlrno, char* part, int)
return nil;
if(ctlrno >= MaxEther)
return nil;
+ if(iniread && getconf("*pxeini") != nil)
+ return nil;
pxether[ctlrno].fs.dev = ctlrno;
pxether[ctlrno].fs.diskread = pxediskread;