X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=NetworkPkg%2FUefiPxeBcDxe%2FPxeBcDhcp4.c;h=140e687736cc4ad142b347cf9d4b2269a495bfda;hb=233ffa90ccd852a8c6a478eb0426731d64598316;hp=9c33835759ee6f1f73bb7bf982c51e68648d4630;hpb=6a4eed9bad1c4fc08df5cf36eed0998417db43c3;p=mirror_edk2.git diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c index 9c33835759..140e687736 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c @@ -320,6 +320,7 @@ PxeBcBuildDhcp4Options ( // // Zero the Guid to indicate NOT programable if failed to get system Guid. // + DEBUG ((EFI_D_WARN, "PXE: Failed to read system GUID from the smbios table!\n")); ZeroMem (OptEnt.Uuid->Guid, sizeof (EFI_GUID)); } @@ -437,7 +438,7 @@ PxeBcCacheDhcp4Packet ( if (Dst->Size < Src->Length) { return EFI_BUFFER_TOO_SMALL; } - + CopyMem (&Dst->Dhcp4, &Src->Dhcp4, Src->Length); Dst->Length = Src->Length; @@ -491,7 +492,7 @@ PxeBcParseDhcp4Packet ( ); } // - // Second, Check if bootfilename and serverhostname is overloaded to carry DHCP options refers to rfc-2132. + // Second, Check if bootfilename and serverhostname is overloaded to carry DHCP options refers to rfc-2132. // If yes, try to parse options from the BootFileName field, then ServerName field. // Option = Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD]; @@ -656,7 +657,7 @@ PxeBcCopyDhcp4Ack ( CopyMem (&Mode->DhcpAck.Dhcpv4, &Ack->Dhcp4, Ack->Length); Mode->DhcpAckReceived = TRUE; } - + return EFI_SUCCESS; } @@ -694,7 +695,7 @@ PxeBcCopyProxyOffer ( if (EFI_ERROR(Status)) { return Status; } - + PxeBcParseDhcp4Packet (&Private->ProxyOffer.Dhcp4); // @@ -870,7 +871,7 @@ PxeBcCacheDhcp4Offer ( // Private->OfferIndex[OfferType][Private->OfferCount[OfferType]] = Private->OfferNum; Private->OfferCount[OfferType]++; - } else if ((OfferType == PxeOfferTypeProxyPxe10 || OfferType == PxeOfferTypeProxyWfm11a) && + } else if ((OfferType == PxeOfferTypeProxyPxe10 || OfferType == PxeOfferTypeProxyWfm11a) && Private->OfferCount[OfferType] < 1) { // // Only cache the first PXE10/WFM11a offer, and discard the others. @@ -1210,6 +1211,8 @@ PxeBcDhcp4CallBack ( return EFI_SUCCESS; } + ASSERT (Packet != NULL); + Private = (PXEBC_PRIVATE_DATA *) Context; Mode = Private->PxeBc.Mode; Callback = Private->PxeBcCallback; @@ -1271,7 +1274,7 @@ PxeBcDhcp4CallBack ( Status = EFI_ABORTED; break; } - + if (Mode->SendGUID) { // // Send the system Guid instead of the MAC address as the hardware address if required. @@ -1280,6 +1283,7 @@ PxeBcDhcp4CallBack ( // // Zero the Guid to indicate NOT programable if failed to get system Guid. // + DEBUG ((EFI_D_WARN, "PXE: Failed to read system GUID from the smbios table!\n")); ZeroMem (Packet->Dhcp4.Header.ClientHwAddr, sizeof (EFI_GUID)); } Packet->Dhcp4.Header.HwAddrLen = (UINT8) sizeof (EFI_GUID); @@ -1305,6 +1309,8 @@ PxeBcDhcp4CallBack ( break; case Dhcp4SelectOffer: + ASSERT (NewPacket != NULL); + // // Select offer by the default policy or by order, and record the SelectIndex // and SelectProxyType. @@ -1466,6 +1472,7 @@ PxeBcDhcp4Discover ( // // Zero the Guid to indicate NOT programable if failed to get system Guid. // + DEBUG ((EFI_D_WARN, "PXE: Failed to read system GUID from the smbios table!\n")); ZeroMem (Token.Packet->Dhcp4.Header.ClientHwAddr, sizeof (EFI_GUID)); } Token.Packet->Dhcp4.Header.HwAddrLen = (UINT8) sizeof (EFI_GUID); @@ -1579,7 +1586,7 @@ PxeBcDhcp4Discover ( } } ON_EXIT: - + if (Token.ResponseList != NULL) { FreePool (Token.ResponseList); } @@ -1599,7 +1606,7 @@ ON_EXIT: **/ EFI_STATUS -PxeBcSetIp4Policy ( +PxeBcSetIp4Policy ( IN PXEBC_PRIVATE_DATA *Private ) { @@ -1619,7 +1626,7 @@ PxeBcSetIp4Policy ( if (EFI_ERROR (Status)) { return Status; } - + if (Policy != Ip4Config2PolicyStatic) { Policy = Ip4Config2PolicyStatic; Status= Ip4Config2->SetData ( @@ -1630,7 +1637,7 @@ PxeBcSetIp4Policy ( ); if (EFI_ERROR (Status)) { return Status; - } + } } return EFI_SUCCESS; @@ -1706,7 +1713,7 @@ PxeBcDhcp4Dora ( if (Status == EFI_TIMEOUT && Private->OfferNum > 0) { Status = EFI_NO_RESPONSE; } - + goto ON_EXIT; }