]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c
MdeModulePkg Ip4Dxe: Remove a redundant function
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Icmp.c
index e5e2b984eedffe7c817fca6e0d8a77d195b23578..511342e786d73d9cfbcecfa10ef0a58aa3830f99 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2018, 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
@@ -72,7 +72,7 @@ mIp4SupportedIcmp[23] = {
 /**\r
   Process the ICMP redirect. Find the instance then update\r
   its route cache.\r
-  \r
+\r
   All kinds of redirect is treated as host redirect as\r
   specified by RFC1122 3.3.1.2:\r
   "Since the subnet mask appropriate to the destination\r
@@ -80,7 +80,7 @@ mIp4SupportedIcmp[23] = {
   message SHOULD be treated identically to a Host Redirect\r
   message;"\r
 \r
-  @param[in]  IpSb               The IP4 service binding instance that received \r
+  @param[in]  IpSb               The IP4 service binding instance that received\r
                                  the packet.\r
   @param[in]  Head               The IP head of the received ICMPpacket.\r
   @param[in]  Packet             The content of the ICMP redirect packet with IP\r
@@ -158,15 +158,15 @@ Ip4ProcessIcmpRedirect (
   update call Ip4ProcessIcmpRedirect to update the IP instance's\r
   route cache, otherwise, deliver the packet to upper layer.\r
 \r
-  @param[in]  IpSb               The IP service that received the packet.\r
-  @param[in]  Head               The IP head of the ICMP error packet\r
-  @param[in]  Packet             The content of the ICMP error with IP head\r
+  @param[in]  IpSb               The IP4 service that received the packet.\r
+  @param[in]  Head               The IP4 head of the ICMP error packet\r
+  @param[in]  Packet             The content of the ICMP error with IP4 head\r
                                  removed.\r
 \r
   @retval EFI_SUCCESS            The ICMP error is processed successfully.\r
   @retval EFI_INVALID_PARAMETER  The packet is invalid\r
   @retval Others                 Failed to process the packet.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 Ip4ProcessIcmpError (\r
@@ -200,9 +200,9 @@ Ip4ProcessIcmpError (
 /**\r
   Replay an ICMP echo request.\r
 \r
-  @param[in]  IpSb               The IP service that receivd the packet\r
-  @param[in]  Head               The IP head of the ICMP error packet\r
-  @param[in]  Packet             The content of the ICMP error with IP head\r
+  @param[in]  IpSb               The IP4 service that receivd the packet\r
+  @param[in]  Head               The IP4 head of the ICMP error packet\r
+  @param[in]  Packet             The content of the ICMP error with IP4 head\r
                                  removed.\r
 \r
   @retval EFI_OUT_OF_RESOURCES   Failed to allocate resource.\r
@@ -267,6 +267,9 @@ Ip4IcmpReplyEcho (
              Ip4SysPacketSent,\r
              NULL\r
              );\r
+  if (EFI_ERROR (Status)) {\r
+    NetbufFree (Data);\r
+  }\r
 \r
 ON_EXIT:\r
   NetbufFree (Packet);\r
@@ -278,9 +281,9 @@ ON_EXIT:
   Process the ICMP query message. If it is an ICMP echo\r
   request, answer it. Otherwise deliver it to upper layer.\r
 \r
-  @param[in]  IpSb               The IP service that receivd the packet\r
-  @param[in]  Head               The IP head of the ICMP query packet\r
-  @param[in]  Packet             The content of the ICMP query with IP head\r
+  @param[in]  IpSb               The IP4 service that receivd the packet\r
+  @param[in]  Head               The IP4 head of the ICMP query packet\r
+  @param[in]  Packet             The content of the ICMP query with IP4 head\r
                                  removed.\r
 \r
   @retval EFI_INVALID_PARAMETER  The packet is invalid\r
@@ -317,9 +320,9 @@ Ip4ProcessIcmpQuery (
   then according to the message types, process it as query or\r
   error packet.\r
 \r
-  @param[in]  IpSb               The IP service that receivd the packet\r
-  @param[in]  Head               The IP head of the ICMP query packet\r
-  @param[in]  Packet             The content of the ICMP query with IP head\r
+  @param[in]  IpSb               The IP4 service that receivd the packet.\r
+  @param[in]  Head               The IP4 head of the ICMP query packet.\r
+  @param[in]  Packet             The content of the ICMP query with IP4 head\r
                                  removed.\r
 \r
   @retval EFI_INVALID_PARAMETER  The packet is malformated.\r