pxeboot uses code in libstand to get information from DHCP. libstand in bootp.c contains logic which effectively breaks CIDR on supernets such as 192.168.0.0/23 and causes the network mask to be truncated to the native classfull mask (/24 in this case). This code is present at least since 3.0-RELEASE and is still in HEAD.
1. Setup standard FreeBSD network booting on a supernet such as 192.168.0.0/23
2. Boot a client on the same network via PXE with root on NFS
3. pxeboot is loaded via TFTP as per dhcpd.conf
4. pxeboot performs a DHCP request
5. pxeboot keeps the assigned IP but discards network mask as "bogus" and uses /24
(gateway might also be discarded if it ends up being in the other C network)
Case 1 - client and NFS server are on the same class C network
6. Client boots normally but after boot keeps the wrong netmask of /24
Case 2 - client and NFS server on different class C networks
6. Client hangs while trying to mount NFS root because it doesn't know how to contact the server
No errors or warnings are logged unless debugging is enabled in libstand. I find that plainly misleading. Even if I configure wrong network mask in DHCP I still don't expect that a client will silently discard it and use another one.
Fix: Expected behavior: pxeboot should respect network mask assigned via DHCP.
Proposed patch attached. Successfully tested on 9.0-RELEASE.
Patch attached with submission follows:
How-To-Repeat: 1. Setup standard FreeBSD network booting on a supernet such as 192.168.0.0/23
2. PXE boot any machine on the same network
For bugs matching the following criteria:
Status: In Progress Changed: (is less than) 2014-06-01
Reset to default assignee and clear in-progress tags.
Mail being skipped