1. In IPv4 and IPv6 driver, before calling IPsec, a new NET_FRAGMENT structure is allocated and then passed to IPsec, it should be released after it is done to avoid the memory leak.
2. In IPsec driver it wrongly use the HeadLen to calculate the IP header length after the IPsec process. Correct this mistake. Signed-off-by: qianouyang Reviewed-by: jjin9 Reviewed-by: ZhangCaoIntel git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11824 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1596,7 +1596,7 @@ IpSecEspInboundPacket (
|
||||
//
|
||||
if (!SadData->Mode == EfiIPsecTunnel) {
|
||||
if (IpVersion == IP_VERSION_4) {
|
||||
((IP4_HEAD *) IpHead)->TotalLen = HTONS ((UINT16) (((IP4_HEAD *) IpHead)->HeadLen + PlainPayloadSize));
|
||||
((IP4_HEAD *) IpHead)->TotalLen = HTONS ((UINT16) ((((IP4_HEAD *) IpHead)->HeadLen << 2) + PlainPayloadSize));
|
||||
} else {
|
||||
IpSecHeadSize = IpSecGetPlainExtHeadSize (IpHead, LastHead);
|
||||
((EFI_IP6_HEADER *) IpHead)->PayloadLength = HTONS ((UINT16)(IpSecHeadSize + PlainPayloadSize));
|
||||
|
Reference in New Issue
Block a user