]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Ip6Dxe/Ip6Output.c
NetworkPkg: Fix typo.
[mirror_edk2.git] / NetworkPkg / Ip6Dxe / Ip6Output.c
index baa4904fc9de15a588984b5c5320e7b8931f01f5..fe642d371ed593860068331912cc0c46533c3375 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The internal functions and routines to transmit the IP6 packet.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -91,7 +91,7 @@ Ip6CandidateSource (
 }\r
 \r
 /**\r
-  Caculate how many bits are the same between two IPv6 addresses.\r
+  Calculate how many bits are the same between two IPv6 addresses.\r
 \r
   @param[in]       AddressA         Points to an IPv6 address.\r
   @param[in]       AddressB         Points to another IPv6 address.\r
@@ -388,6 +388,8 @@ Ip6PrependHead (
   EFI_STATUS                Status;\r
   UINT8                     NextHeader;\r
 \r
+  UpdatedExtHdrs = NULL;\r
+\r
   //\r
   // HeadLen is the length of the fixed part of the sequences of fragments, i.e.\r
   // the unfragment part.\r
@@ -638,11 +640,11 @@ Ip6Output (
 \r
   Status = Ip6IpSecProcessPacket (\r
              IpSb,\r
-             Head,\r
+             &Head,\r
              LastHeader, // no need get the lasthead value for output\r
              &Packet,\r
-             ExtHdrs,\r
-             ExtHdrsLen,\r
+             &ExtHdrs,\r
+             &ExtHdrsLen,\r
              EfiIPsecOutBound,\r
              Context\r
              );\r
@@ -689,13 +691,25 @@ Ip6Output (
     // For unicast packets, use a combination of the Destination Cache, the Prefix List\r
     // and the Default Router List to determine the IP address of the appropriate next hop.\r
     //\r
-    RouteCache = Ip6Route (IpSb, &Head->DestinationAddress, &Head->SourceAddress);\r
-    if (RouteCache == NULL) {\r
-      return EFI_NOT_FOUND;\r
-    }\r
 \r
-    IP6_COPY_ADDRESS (&NextHop, &RouteCache->NextHop);\r
-    Ip6FreeRouteCacheEntry (RouteCache);\r
+    NeighborCache = Ip6FindNeighborEntry (IpSb, &Head->DestinationAddress);\r
+    if (NeighborCache != NULL) {\r
+      //\r
+      // Hit Neighbor Cache.\r
+      //\r
+      IP6_COPY_ADDRESS (&NextHop, &Head->DestinationAddress);\r
+    } else {\r
+      //\r
+      // Not in Neighbor Cache, check Router cache\r
+      //\r
+      RouteCache = Ip6Route (IpSb, &Head->DestinationAddress, &Head->SourceAddress);\r
+      if (RouteCache == NULL) {\r
+        return EFI_NOT_FOUND;\r
+      }\r
+\r
+      IP6_COPY_ADDRESS (&NextHop, &RouteCache->NextHop);\r
+      Ip6FreeRouteCacheEntry (RouteCache);\r
+    }\r
   }\r
 \r
   //\r