diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-14 02:37:23 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-14 02:37:23 +0000 |
commit | 2ce5c88a7adaea3eeeccc932b18da5f02440f8cd (patch) | |
tree | 1023fcd9399f5e60c1f37fa3fe3eede158e8f9c2 /MdeModulePkg | |
parent | b55f8b0146ab1a0b26909a63bb04ba850b9ba198 (diff) | |
download | edk2-platforms-2ce5c88a7adaea3eeeccc932b18da5f02440f8cd.tar.xz |
Use siaddr in DHCP packet, if zero, use option 54 instead.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9066 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 7 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c index 1d5557f7a9..5e86cf5779 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c @@ -275,10 +275,11 @@ PxeBcTryBinl ( Offer = &Private->Dhcp4Offers[Index].Packet.Offer;
//
- // use option 54, if zero, use siaddr in header
+ // Use siaddr(next server) in DHCPOFFER packet header, if zero, use option 54(server identifier)
+ // in DHCPOFFER packet.
+ // (It does not comply with PXE Spec, Ver2.1)
//
- ZeroMem (&ServerIp, sizeof(EFI_IP_ADDRESS));
- if (Private->Dhcp4Offers[Index].Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_SERVER_ID] != NULL) {
+ if (EFI_IP4_EQUAL (&Offer->Dhcp4.Header.ServerAddr.Addr, &mZeroIp4Addr)) {
CopyMem (
&ServerIp.Addr[0],
Private->Dhcp4Offers[Index].Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_SERVER_ID]->Data,
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c index 3eeacdcc5c..659f638930 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c @@ -2480,9 +2480,11 @@ DiscoverBootFile ( }
//
- // use option 54, if zero, use siaddr in header
+ // Use siaddr(next server) in DHCPOFFER packet header, if zero, use option 54(server identifier)
+ // in DHCPOFFER packet.
+ // (It does not comply with PXE Spec, Ver2.1)
//
- if (Packet->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_SERVER_ID] != NULL) {
+ if (EFI_IP4_EQUAL (&Packet->Packet.Offer.Dhcp4.Header.ServerAddr, &mZeroIp4Addr)) {
CopyMem (
&Private->ServerIp,
Packet->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_SERVER_ID]->Data,
|