enhanced UefiPxeBcDxe to support
1. AutoArp. 2. SendGuid. 3 TftpError. 4. IcmpError. 5. RouteTable. 6. ArpCache. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4981 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -57,7 +57,7 @@ EfiDhcp4GetModeData (
|
||||
}
|
||||
|
||||
Instance = DHCP_INSTANCE_FROM_THIS (This);
|
||||
|
||||
|
||||
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
|
||||
DhcpSb = Instance->Service;
|
||||
|
||||
@@ -840,7 +840,7 @@ Returns:
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
{
|
||||
}
|
||||
|
||||
VOID
|
||||
@@ -873,14 +873,14 @@ PxeDhcpInput (
|
||||
}
|
||||
|
||||
ASSERT (UdpPacket != NULL);
|
||||
|
||||
|
||||
//
|
||||
// Validate the packet received
|
||||
//
|
||||
if (UdpPacket->TotalSize < sizeof (EFI_DHCP4_HEADER)) {
|
||||
goto RESTART;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Copy the DHCP message to a continuous memory block, make the buffer size
|
||||
// of the EFI_DHCP4_PACKET a multiple of 4-byte.
|
||||
@@ -900,16 +900,16 @@ PxeDhcpInput (
|
||||
if (Packet->Length != UdpPacket->TotalSize) {
|
||||
goto RESTART;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Is this packet the answer to our packet?
|
||||
//
|
||||
if ((Head->OpCode != BOOTP_REPLY) ||
|
||||
(Head->Xid != Token->Packet->Dhcp4.Header.Xid) ||
|
||||
!NET_MAC_EQUAL (&DhcpSb->Mac, Head->ClientHwAddr, DhcpSb->HwLen)) {
|
||||
(CompareMem (DhcpSb->ClientAddressSendOut, Head->ClientHwAddr, Head->HwAddrLen) != 0)) {
|
||||
goto RESTART;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Validate the options and retrieve the interested options
|
||||
//
|
||||
@@ -979,7 +979,7 @@ SIGNAL_USER:
|
||||
|
||||
if (Token->CompletionEvent != NULL) {
|
||||
gBS->SignalEvent (Token->CompletionEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1066,6 +1066,11 @@ EfiDhcp4TransmitReceive (
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// Save the Client Address is sent out
|
||||
//
|
||||
CopyMem (&DhcpSb->ClientAddressSendOut[0], &Token->Packet->Dhcp4.Header.ClientHwAddr[0], Token->Packet->Dhcp4.Header.HwAddrLen);
|
||||
|
||||
//
|
||||
// Wrap the DHCP packet into a net buffer.
|
||||
//
|
||||
|
@@ -122,6 +122,7 @@ struct _DHCP_SERVICE {
|
||||
EFI_MAC_ADDRESS Mac;
|
||||
UINT8 HwType;
|
||||
UINT8 HwLen;
|
||||
UINT8 ClientAddressSendOut[16];
|
||||
|
||||
DHCP_PROTOCOL *ActiveChild;
|
||||
EFI_DHCP4_CONFIG_DATA ActiveConfig;
|
||||
|
@@ -1037,7 +1037,7 @@ DhcpInput (
|
||||
//
|
||||
if ((Head->OpCode != BOOTP_REPLY) ||
|
||||
(NTOHL (Head->Xid) != DhcpSb->Xid) ||
|
||||
!NET_MAC_EQUAL (&DhcpSb->Mac, Head->ClientHwAddr, DhcpSb->HwLen)) {
|
||||
(CompareMem (DhcpSb->ClientAddressSendOut, Head->ClientHwAddr, Head->HwAddrLen) != 0)) {
|
||||
goto RESTART;
|
||||
}
|
||||
|
||||
@@ -1361,6 +1361,12 @@ DhcpSendMessage (
|
||||
Packet = NewPacket;
|
||||
}
|
||||
|
||||
//
|
||||
// Save the Client Address will be sent out
|
||||
//
|
||||
CopyMem (&DhcpSb->ClientAddressSendOut[0], &Packet->Dhcp4.Header.ClientHwAddr[0], Packet->Dhcp4.Header.HwAddrLen);
|
||||
|
||||
|
||||
//
|
||||
// Wrap it into a netbuf then send it.
|
||||
//
|
||||
@@ -1492,7 +1498,7 @@ DhcpOnTimerTick (
|
||||
DHCP_SERVICE *DhcpSb;
|
||||
DHCP_PROTOCOL *Instance;
|
||||
EFI_STATUS Status;
|
||||
|
||||
|
||||
DhcpSb = (DHCP_SERVICE *) Context;
|
||||
Instance = DhcpSb->ActiveChild;
|
||||
|
||||
@@ -1513,7 +1519,7 @@ DhcpOnTimerTick (
|
||||
goto END_SESSION;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Check the retransmit timer
|
||||
//
|
||||
@@ -1558,7 +1564,7 @@ DhcpOnTimerTick (
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// If an address has been acquired, check whether need to
|
||||
// refresh or whether it has expired.
|
||||
|
Reference in New Issue
Block a user