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
This commit is contained in:
Martin Cracauer
2026-05-24 11:43:00 -04:00
parent 11d69a4558
commit d2c21935e8
2 changed files with 13 additions and 0 deletions
+8
View File
@@ -130,6 +130,14 @@ In all other respects,
acts just like
.Xr loader 8 .
.Pp
.Nm
requires NFS over UDP.
Many recent distributions of Linux only serve NFS over TCP.
Enable UDP in some distributions by uncommenting
.Ql udp=y
in
.Pa /etc/nfs.conf .
.Pp
For further information on Intel's PXE specifications and Wired for
Management (WfM) systems, see
.Li http://www.pix.net/software/pxeboot/archive/pxespec.pdf .
+5
View File
@@ -415,6 +415,11 @@ rpc_getport(struct iodesc *d, n_long prog, n_long vers)
return (-1);
}
port = (int)ntohl(res->port);
if (port == 0) {
printf("Portmapper returned 0. TCP-only NFS server?\n");
free(pkt);
return (-1);
}
free(pkt);
rpc_pmap_putcache(d->destip, prog, vers, port);