[ipxe-devel] DHCP/ProxyDHCP settings ordering bug

Alex Williamson alex.williamson at redhat.com
Thu Jun 6 22:37:38 UTC 2013


Hi,

iPXE current does not behave correctly in the presence of PXE discovery
control PXEBS_SKIP, seemingly due to the ordering or the registration of
settings between normal DHCP and ProxyDHCP.  Imagine this scenario:

server1 (10.0.0.1) - Primary DHCP

dnsmasq.conf:
dhcp-range=10.0.0.100,10.0.0.254,255.255.255.0,10m

server2 (10.0.0.2) - PXE Server

dnsmasq.conf
dhcp-boot=pxelinux.0,10.0.0.3
# Don't really want suboption 6, but dnsmasq adds
# it as a second suboption 6 and it gets ignored.
# Not sure how to specify nothing (not the problem).
dhcp-option=vendor:PXEClient,6,2b
dhcp-range=10.0.0.1,proxy
# We don't really want pxe-prompt either, but
# without it dnsmasq won't participate (also not
# the problem).
pxe-prompt=Press [F8] to select a boot option,30

server3 (10.0.0.3) - TFTP server

In this mode, dnsmasq on server2 adds the PXEBS_SKIP option because a
filename is specified and no pxe-service options are specified (verified
with wireshark).  The above can be made to work, but that's not the
point.  This is a dnsmasq recreation of a real problem.

The intended behavior is that server1 provides the network setup
information and server2 provides the next-server and filename for direct
booting for PXE clients.  Thus the correct boot URI is
tftp://10.0.0.3/pxelinux.0

When iPXE tries to boot in the above environment, it tries to load
tftp://10.0.0.1/pxelinux.0 as the boot file.  The next-server comes from
server1's DHCP packet and filename comes from server2's.  Clearly this
is wrong.

>From what I can gather, this is a result of neither packet having a
priority and the ordering of adding the settings from the DHCP packet
before the ProxyDHCP packet.  list_add_tail bites us.  DHCP packets
don't support reallocation, so I can't add an artificial priority to get
them in the correct order.  Registering the settings from the ProxyDHCP
packet before the DHCP packet does work, but it's ugly and prone to
being broken by changes to the list manipulation code in settings.
Suggestions?  Thanks,

Alex




More information about the ipxe-devel mailing list