]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
Per UEFI spec, SetMode() should clear screen anyway with black color.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / UefiPxeBcDxe / PxeBcDhcp.c
index db19d15ead436bfa22c26cc1b4f74626ae7e4c8a..920506b246c5d9c0d45e8f441bd2f7e099419f2f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support for PxeBc dhcp functions.\r
   \r
-Copyright (c) 2007 - 2008, Intel Corporation.<BR>                                                         \r
+Copyright (c) 2007 - 2009, Intel Corporation.<BR>                                                         \r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -277,20 +277,26 @@ PxeBcTryBinl (
   ASSERT (Private->Dhcp4Offers[Index].OfferType == DHCP4_PACKET_TYPE_BINL);\r
 \r
   Offer = &Private->Dhcp4Offers[Index].Packet.Offer;\r
-  if (Offer->Dhcp4.Header.ServerAddr.Addr[0] == 0) {\r
-    //\r
-    // next server ip address is zero, use server id option instead.\r
-    //\r
+\r
+  //\r
+  // use option 54, if zero, use siaddr in header\r
+  //\r
+  ZeroMem (&ServerIp, sizeof(EFI_IP_ADDRESS));\r
+  if (Private->Dhcp4Offers[Index].Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_SERVER_ID] != NULL) {\r
     CopyMem (\r
       &ServerIp.Addr[0],\r
       Private->Dhcp4Offers[Index].Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_SERVER_ID]->Data,\r
       sizeof (EFI_IPv4_ADDRESS)\r
       );\r
   } else {\r
-    //\r
-    // use next server ip address.\r
-    //\r
-    CopyMem (&ServerIp.Addr[0], &Offer->Dhcp4.Header.ServerAddr, sizeof (EFI_IPv4_ADDRESS));\r
+    CopyMem (\r
+      &ServerIp.Addr[0], \r
+      &Offer->Dhcp4.Header.ServerAddr, \r
+      sizeof (EFI_IPv4_ADDRESS)\r
+      );\r
+  }\r
+  if (ServerIp.Addr[0] == 0) {\r
+    return FALSE;\r
   }\r
 \r
   CachedPacket = &Private->ProxyOffer;\r
@@ -760,6 +766,7 @@ PxeBcSelectOffer (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 PxeBcDhcpCallBack (\r
   IN EFI_DHCP4_PROTOCOL                * This,\r
   IN VOID                              *Context,\r