]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c
MdeModulePkg: INF/DEC file updates to EDK II packages
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Icmp.c
index 76208e071bb49cb41ff8086e40acc5ba39a557dc..e5e2b984eedffe7c817fca6e0d8a77d195b23578 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 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
@@ -105,6 +105,8 @@ Ip4ProcessIcmpRedirect (
   IP4_ROUTE_CACHE_ENTRY     *CacheEntry;\r
   IP4_INTERFACE             *IpIf;\r
   IP4_ADDR                  Gateway;\r
+  IP4_ADDR                  Src;\r
+  IP4_ADDR                  Dst;\r
 \r
   //\r
   // Find the interface whose IP address is the source of the\r
@@ -133,11 +135,9 @@ Ip4ProcessIcmpRedirect (
       continue;\r
     }\r
 \r
-    CacheEntry = Ip4FindRouteCache (\r
-                   Ip4Instance->RouteTable,\r
-                   NTOHL (Icmp->IpHead.Dst),\r
-                   NTOHL (Icmp->IpHead.Src)\r
-                   );\r
+    Dst = NTOHL (Icmp->IpHead.Dst);\r
+    Src = NTOHL (Icmp->IpHead.Src);\r
+    CacheEntry = Ip4FindRouteCache (Ip4Instance->RouteTable, Dst, Src);\r
 \r
     //\r
     // Only update the route cache's gateway if the source of the\r
@@ -193,7 +193,7 @@ Ip4ProcessIcmpError (
   }\r
 \r
   IP4_GET_CLIP_INFO (Packet)->Status = EFI_ICMP_ERROR;\r
-  return Ip4Demultiplex (IpSb, Head, Packet);\r
+  return Ip4Demultiplex (IpSb, Head, Packet, NULL, 0);\r
 }\r
 \r
 \r
@@ -240,6 +240,7 @@ Ip4IcmpReplyEcho (
   // update is omitted.\r
   //\r
   Icmp                = (IP4_ICMP_QUERY_HEAD *) NetbufGetByte (Data, 0, NULL);\r
+  ASSERT (Icmp != NULL);\r
   Icmp->Head.Type     = ICMP_ECHO_REPLY;\r
   Icmp->Head.Checksum = 0;\r
   Icmp->Head.Checksum = (UINT16) (~NetblockChecksum ((UINT8 *) Icmp, Data->TotalSize));\r
@@ -307,7 +308,7 @@ Ip4ProcessIcmpQuery (
     return Ip4IcmpReplyEcho (IpSb, Head, Packet);\r
   }\r
 \r
-  return Ip4Demultiplex (IpSb, Head, Packet);\r
+  return Ip4Demultiplex (IpSb, Head, Packet, NULL, 0);\r
 }\r
 \r
 \r