/** @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 - 2011, 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
\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
// 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