]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c
sync comments, fix function header, rename variable name to follow coding style.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Impl.c
index 514e33e925d223fd8aa6f468168346360c8272af..6097f0d3d728e59ac24cd12283a8cf71b5708aac 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation\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
@@ -35,7 +35,6 @@ Abstract:
                                  operation parameter.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EfiDhcp4GetModeData (\r
@@ -57,7 +56,7 @@ EfiDhcp4GetModeData (
   }\r
 \r
   Instance = DHCP_INSTANCE_FROM_THIS (This);\r
-  \r
+\r
   OldTpl  = gBS->RaiseTPL (TPL_CALLBACK);\r
   DhcpSb  = Instance->Service;\r
 \r
@@ -286,7 +285,6 @@ DhcpYieldControl (
   @retval EFI_SUCCESS            The child is configured.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EfiDhcp4Configure (\r
@@ -407,7 +405,6 @@ ON_EXIT:
   @retval EFI_SUCCESS            The DHCP process is started.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EfiDhcp4Start (\r
@@ -497,7 +494,6 @@ ON_ERROR:
   @retval EFI_SUCCESS            The DHCP is renewed/rebound.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EfiDhcp4RenewRebind (\r
@@ -597,7 +593,6 @@ ON_ERROR:
   @retval EFI_SUCCESS            The lease is released.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EfiDhcp4Release (\r
@@ -664,7 +659,6 @@ ON_EXIT:
   @retval EFI_SUCCESS            The DHCP process is stopped.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EfiDhcp4Stop (\r
@@ -719,7 +713,6 @@ EfiDhcp4Stop (
   @retval EFI_SUCCESS            The packet is build.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EfiDhcp4Build (\r
@@ -762,7 +755,6 @@ EfiDhcp4Build (
            );\r
 }\r
 \r
-STATIC\r
 EFI_STATUS\r
 Dhcp4InstanceConfigUdpIo (\r
   IN UDP_IO_PORT  *UdpIo,\r
@@ -801,7 +793,6 @@ Dhcp4InstanceConfigUdpIo (
   return UdpIo->Udp->Configure (UdpIo->Udp, &UdpConfigData);\r
 }\r
 \r
-STATIC\r
 EFI_STATUS\r
 Dhcp4InstanceCreateUdpIo (\r
   IN DHCP_PROTOCOL  *Instance\r
@@ -820,7 +811,6 @@ Dhcp4InstanceCreateUdpIo (
   }\r
 }\r
 \r
-STATIC\r
 VOID\r
 DhcpDummyExtFree (\r
   IN VOID                   *Arg\r
@@ -840,7 +830,7 @@ Returns:
   None\r
 \r
 --*/\r
-{  \r
+{\r
 }\r
 \r
 VOID\r
@@ -873,14 +863,14 @@ PxeDhcpInput (
   }\r
 \r
   ASSERT (UdpPacket != NULL);\r
-  \r
+\r
   //\r
   // Validate the packet received\r
   //\r
   if (UdpPacket->TotalSize < sizeof (EFI_DHCP4_HEADER)) {\r
     goto RESTART;\r
   }\r
-  \r
+\r
   //\r
   // Copy the DHCP message to a continuous memory block, make the buffer size\r
   // of the EFI_DHCP4_PACKET a multiple of 4-byte.\r
@@ -900,16 +890,16 @@ PxeDhcpInput (
   if (Packet->Length != UdpPacket->TotalSize) {\r
     goto RESTART;\r
   }\r
-  \r
+\r
   //\r
   // Is this packet the answer to our packet?\r
   //\r
   if ((Head->OpCode != BOOTP_REPLY) ||\r
       (Head->Xid != Token->Packet->Dhcp4.Header.Xid) ||\r
-      !NET_MAC_EQUAL (&DhcpSb->Mac, Head->ClientHwAddr, DhcpSb->HwLen)) {\r
+      (CompareMem (DhcpSb->ClientAddressSendOut, Head->ClientHwAddr, Head->HwAddrLen) != 0)) {\r
     goto RESTART;\r
   }\r
-  \r
+\r
   //\r
   // Validate the options and retrieve the interested options\r
   //\r
@@ -979,7 +969,7 @@ SIGNAL_USER:
 \r
   if (Token->CompletionEvent != NULL) {\r
     gBS->SignalEvent (Token->CompletionEvent);\r
-  }  \r
+  }\r
 }\r
 \r
 \r
@@ -998,7 +988,6 @@ SIGNAL_USER:
   @retval Others                Some other unexpected error occurred.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EfiDhcp4TransmitReceive (\r
@@ -1066,6 +1055,11 @@ EfiDhcp4TransmitReceive (
     goto ON_ERROR;\r
   }\r
 \r
+  //\r
+  // Save the Client Address is sent out\r
+  //\r
+  CopyMem (&DhcpSb->ClientAddressSendOut[0], &Token->Packet->Dhcp4.Header.ClientHwAddr[0], Token->Packet->Dhcp4.Header.HwAddrLen);\r
+\r
   //\r
   // Wrap the DHCP packet into a net buffer.\r
   //\r
@@ -1160,7 +1154,6 @@ ON_ERROR:
   @retval EFI_SUCCESS            It always returns EFI_SUCCESS\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 Dhcp4ParseCheckOption (\r
   IN UINT8                  Tag,\r
@@ -1202,7 +1195,6 @@ Dhcp4ParseCheckOption (
   @retval EFI_SUCCESS            The options are parsed.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EfiDhcp4Parse (\r