summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-04-16 05:55:32 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-04-16 05:55:32 +0000
commit9887e0d069ef44bff56733d2c1eb5a1064311fea (patch)
tree3d6870c4163d091b4a178a2e45d1e9bcce52e7f3 /EdkModulePkg/Universal
parent56056c7cd8c829baa5941f5650b3739e074c7f71 (diff)
downloadedk2-platforms-9887e0d069ef44bff56733d2c1eb5a1064311fea.tar.xz
Use siaddr as the PXE server address first and use option 54 when siaddr is NULL.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2571 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal')
-rw-r--r--EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c b/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c
index 56893bce2f..a1f4715cd0 100644
--- a/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c
+++ b/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c
@@ -1607,14 +1607,19 @@ TryBINL (
DhcpRxBuf = &RxBuf[OfferIx];
//
- // send DHCP request
- // if fail return false
+ // use next server address first.
//
- CopyMem (
- ((EFI_IPv4_ADDRESS *) &ServerIp),
- &((DHCPV4_OP_SERVER_IP *) DhcpRxBuf->OpAdds.PktOptAdds[OP_DHCP_SERVER_IP_IX - 1])->Ip,
- sizeof (EFI_IPv4_ADDRESS)
- );
+ ServerIp.Addr[0] = DhcpRxBuf->u.Dhcpv4.siaddr;
+ if (ServerIp.Addr[0] == 0) {
+ //
+ // next server address is NULL, use option 54.
+ //
+ CopyMem (
+ ((EFI_IPv4_ADDRESS *) &ServerIp),
+ &((DHCPV4_OP_SERVER_IP *) DhcpRxBuf->OpAdds.PktOptAdds[OP_DHCP_SERVER_IP_IX - 1])->Ip,
+ sizeof (EFI_IPv4_ADDRESS)
+ );
+ }
//
// client IP address - filled in by client if it knows it