Skip to content

Commit d2c2193

Browse files
Martin CracauerMartin Cracauer
authored andcommitted
pxeboot: warn and abort on TCP-only NFS server, which doesn't work for pxeboot
When pxeboot gets a 0 as a port number from portmapper (indicating an error), it currently happily sends NFS packets to the server's port 0 in an endless loop. Change this to instead bail out with a useful message. This happens, for example, with recent Linux NFS servers as many distributions switched to TCP only NFS serving by default. FreeBSD's pxeboot must have UDP. In this situation pxeboot asks the server's portmapper for the UDP NFS port and since there is none gets 0. Also add a hint to the manpage explaining this and how to fix it. Reviewed by: ziaee, kevans, imp
1 parent 11d69a4 commit d2c2193

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

stand/i386/pxeldr/pxeboot.8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ In all other respects,
130130
acts just like
131131
.Xr loader 8 .
132132
.Pp
133+
.Nm
134+
requires NFS over UDP.
135+
Many recent distributions of Linux only serve NFS over TCP.
136+
Enable UDP in some distributions by uncommenting
137+
.Ql udp=y
138+
in
139+
.Pa /etc/nfs.conf .
140+
.Pp
133141
For further information on Intel's PXE specifications and Wired for
134142
Management (WfM) systems, see
135143
.Li http://www.pix.net/software/pxeboot/archive/pxespec.pdf .

stand/libsa/rpc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ rpc_getport(struct iodesc *d, n_long prog, n_long vers)
415415
return (-1);
416416
}
417417
port = (int)ntohl(res->port);
418+
if (port == 0) {
419+
printf("Portmapper returned 0. TCP-only NFS server?\n");
420+
free(pkt);
421+
return (-1);
422+
}
418423
free(pkt);
419424

420425
rpc_pmap_putcache(d->destip, prog, vers, port);

0 commit comments

Comments
 (0)