]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c
1. Add EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() support.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Udp4Dxe / Udp4Impl.c
index de9ee2cacac251ff57e2e917d93677666bcb23bf..8bba3572a24d590c375636a3f9140b25e0ba100d 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   The implementation of the Udp4 protocol.\r
   \r
-Copyright (c) 2006 - 2010, Intel Corporation.<BR>                                                         \r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+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
 http://opensource.org/licenses/bsd-license.php\r
@@ -59,17 +59,17 @@ Udp4FindInstanceByPort (
 \r
   @param[in]  Status                 The completion status of the output udp datagram.\r
   @param[in]  Context                Pointer to the context data.\r
-  @param[in]  Sender                 Pointer to the Ip sender of the udp datagram.\r
+  @param[in]  Sender                 Specify a pointer of EFI_IP4_PROTOCOL for sending.\r
   @param[in]  NotifyData             Pointer to the notify data.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 Udp4DgramSent (\r
-  IN EFI_STATUS  Status,\r
-  IN VOID        *Context,\r
-  IN VOID        *Sender,\r
-  IN VOID        *NotifyData\r
+  IN EFI_STATUS        Status,\r
+  IN VOID              *Context,\r
+  IN IP_IO_IP_PROTOCOL Sender,\r
+  IN VOID              *NotifyData\r
   );\r
 \r
 /**\r
@@ -431,7 +431,7 @@ Udp4CheckTimeout (
       //\r
       // TimeoutTick unit is microsecond, MNP_TIMEOUT_CHECK_INTERVAL unit is 100ns.\r
       //\r
-      if (Wrap->TimeoutTick <= (UDP4_TIMEOUT_INTERVAL / 10)) {\r
+      if (Wrap->TimeoutTick < (UDP4_TIMEOUT_INTERVAL / 10)) {\r
         //\r
         // Remove this RxData if it timeouts.\r
         //\r
@@ -484,7 +484,7 @@ Udp4InitInstance (
   Instance->IcmpError   = EFI_SUCCESS;\r
   Instance->Configured  = FALSE;\r
   Instance->IsNoMapping = FALSE;\r
-  Instance->Destroyed   = FALSE;\r
+  Instance->InDestroy   = FALSE;\r
 }\r
 \r
 \r
@@ -989,17 +989,17 @@ Udp4RemoveToken (
 \r
   @param[in]  Status                 The completion status of the output udp datagram.\r
   @param[in]  Context                Pointer to the context data.\r
-  @param[in]  Sender                 Pointer to the Ip sender of the udp datagram.\r
+  @param[in]  Sender                 Specify a pointer of EFI_IP4_PROTOCOL for sending.\r
   @param[in]  NotifyData             Pointer to the notify data.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 Udp4DgramSent (\r
-  IN EFI_STATUS  Status,\r
-  IN VOID        *Context,\r
-  IN VOID        *Sender,\r
-  IN VOID        *NotifyData\r
+  IN EFI_STATUS        Status,\r
+  IN VOID              *Context,\r
+  IN IP_IO_IP_PROTOCOL Sender,\r
+  IN VOID              *NotifyData\r
   )\r
 {\r
   UDP4_INSTANCE_DATA         *Instance;\r
@@ -1612,6 +1612,7 @@ Udp4Demultiplex (
   // Get the datagram header from the packet buffer.\r
   //\r
   Udp4Header = (EFI_UDP_HEADER *) NetbufGetByte (Packet, 0, NULL);\r
+  ASSERT (Udp4Header != NULL);\r
 \r
   if (Udp4Header->Checksum != 0) {\r
     //\r
@@ -1799,6 +1800,7 @@ Udp4IcmpHandler (
   UDP4_INSTANCE_DATA     *Instance;\r
 \r
   Udp4Header = (EFI_UDP_HEADER *) NetbufGetByte (Packet, 0, NULL);\r
+  ASSERT (Udp4Header != NULL);\r
 \r
   CopyMem (&Udp4Session.SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS));\r
   CopyMem (&Udp4Session.DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));\r