From 0a4a04969d17ae5b07dcbfd322a1e4e1b94d0066 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Sun, 15 May 2016 20:13:45 +0100 Subject: [PATCH] Final PXE tweak, and release-note to reflect changes. --- CHANGELOG | 15 +++++++++++++++ src/rfc2131.c | 14 ++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7012918..c73ddc2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -84,6 +84,21 @@ version 2.76 Add ARM32_EFI and ARM64_EFI as valid architectures in --pxe-service. + Fix PXE booting for UEFI architectures. Modify PXE boot + sequence in this case to force the client to talk to dnsmasq + over port 4011. This makes PXE and especially proxy-DHCP PXE + work with these archictectures. + + Workaround problems with UEFI PXE clients. There exist + in the wild PXE clients which have problems with PXE + boot menus. To work around this, when there's a single + --pxe-service which applies to client, then that target + will be booted directly, rather then sending a + single-item boot menu. + + Many thanks to Jarek Polok, Michael Kuron and Dreamcat4 + for their work on the long-standing UEFI PXE problem. + version 2.75 Fix reversion on 2.74 which caused 100% CPU use when a diff --git a/src/rfc2131.c b/src/rfc2131.c index 175724b..b7c167e 100644 --- a/src/rfc2131.c +++ b/src/rfc2131.c @@ -864,7 +864,8 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index, if (tmp) { struct dhcp_boot *boot; - + int redirect4011 = 0; + if (tmp->netid.net) { tmp->netid.next = netid; @@ -882,8 +883,13 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index, clear_packet(mess, end); - /* Redirect the client to port 4011 */ - mess->siaddr = tmp->local; + /* Redirect EFI clients to port 4011 */ + if (pxearch >= 6) + { + redirect4011 = 1; + mess->siaddr = tmp->local; + } + /* Returns true if only one matching service is available. On port 4011, it also inserts the boot file and server name. */ workaround = pxe_uefi_workaround(pxearch, tagif_netid, mess, tmp->local, now, pxe); @@ -906,7 +912,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index, option_put(mess, end, OPTION_SERVER_IDENTIFIER, INADDRSZ, htonl(tmp->local.s_addr)); pxe_misc(mess, end, uuid); prune_vendor_opts(tagif_netid); - if (pxe && !workaround) + if ((pxe && !workaround) || !redirect4011) do_encap_opts(pxe_opts(pxearch, tagif_netid, tmp->local, now), OPTION_VENDOR_CLASS_OPT, DHOPT_VENDOR_MATCH, mess, end, 0); log_packet("PXE", NULL, emac, emac_len, iface_name, ignore ? "proxy-ignored" : "proxy", NULL, mess->xid);