[syslinux:master] efi/pxe: Use the appropriate 3rd packet

syslinux-bot for Patrick Masotta masottaus at yahoo.com
Tue May 26 16:48:07 PDT 2015


Commit-ID:  81eeaa3ea93ef124d4308f622ee29673e534dc0c
Gitweb:     http://www.syslinux.org/commit/81eeaa3ea93ef124d4308f622ee29673e534dc0c
Author:     Patrick Masotta <masottaus at yahoo.com>
AuthorDate: Mon, 25 May 2015 14:30:30 -0400
Committer:  Gene Cumm <gene.cumm at gmail.com>
CommitDate: Tue, 26 May 2015 19:45:10 -0400

efi/pxe: Use the appropriate 3rd packet

EFI allows us to have access to more DHCP-related packets.  Choose the
packet with the highest priority for the third to parse.

Signed-off-by: Patrick Masotta <masottaus at yahoo.com>
[gene.cumm at gmail.com: Only change the third parsing iteration;
  reflow to better fit code standards; don't reparse DhcpAck]
Signed-off-by: Gene Cumm <gene.cumm at gmail.com>

---
 efi/pxe.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/efi/pxe.c b/efi/pxe.c
index 38f0018..0aa6e19 100644
--- a/efi/pxe.c
+++ b/efi/pxe.c
@@ -154,7 +154,15 @@ void net_parse_dhcp(void)
      * Get the boot file and other info. This lives in the CACHED_REPLY
      * packet (BIOS/PXE query info 3)
      */
-    parse_dhcp(&mode->PxeReply.Dhcpv4, pkt_len);
+    EFI_PXE_BASE_CODE_DHCPV4_PACKET*     pkt_v4 = NULL;
+
+    if (mode->PxeReplyReceived)
+	pkt_v4 = &mode->PxeReply.Dhcpv4;
+    else if (mode->ProxyOfferReceived)
+	pkt_v4 = &mode->ProxyOffer.Dhcpv4;
+
+    if (pkt_v4)
+	parse_dhcp(pkt_v4, pkt_len);
     Print(L"\n");
 
     /*


More information about the Syslinux-commits mailing list