From 94b928ca595def75b918daacdefb70832b28882d Mon Sep 17 00:00:00 2001 From: qianouyang Date: Tue, 14 Jun 2011 09:45:59 +0000 Subject: 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 --- NetworkPkg/IpSecDxe/IpSecImpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'NetworkPkg/IpSecDxe') diff --git a/NetworkPkg/IpSecDxe/IpSecImpl.c b/NetworkPkg/IpSecDxe/IpSecImpl.c index 63abfa6..fe3a604 100644 --- a/NetworkPkg/IpSecDxe/IpSecImpl.c +++ b/NetworkPkg/IpSecDxe/IpSecImpl.c @@ -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)); -- cgit v1.1