aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Cracauer <cracauer@FreeBSD.org>2026-05-24 15:43:00 +0000
committerMartin Cracauer <cracauer@FreeBSD.org>2026-05-24 15:43:00 +0000
commitd2c21935e8666f5e9a38e27701445f5acc82465d (patch)
tree2b409288e123a6abf19706d70e4576c22625d5d3
parent11d69a4558de2a5427d8191caed315c5f7e9a5d6 (diff)
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
-rw-r--r--stand/i386/pxeldr/pxeboot.88
-rw-r--r--stand/libsa/rpc.c5
2 files changed, 13 insertions, 0 deletions
diff --git a/stand/i386/pxeldr/pxeboot.8 b/stand/i386/pxeldr/pxeboot.8
index 496b244cf00f..aa6a5d5c5f7f 100644
--- a/stand/i386/pxeldr/pxeboot.8
+++ b/stand/i386/pxeldr/pxeboot.8
@@ -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 .
diff --git a/stand/libsa/rpc.c b/stand/libsa/rpc.c
index 6b11282a10be..bc5412f1efeb 100644
--- a/stand/libsa/rpc.c
+++ b/stand/libsa/rpc.c
@@ -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);