diff options
author | qianouyang <qianouyang@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-14 09:45:59 +0000 |
---|---|---|
committer | qianouyang <qianouyang@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-14 09:45:59 +0000 |
commit | 94b928ca595def75b918daacdefb70832b28882d (patch) | |
tree | 0702503ae527c5f129de321a74282aaed6dc0af9 /NetworkPkg/IpSecDxe | |
parent | 08cd970203c092f4460ebb4f227745b69a633824 (diff) | |
download | edk2-platforms-94b928ca595def75b918daacdefb70832b28882d.tar.xz |
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
Diffstat (limited to 'NetworkPkg/IpSecDxe')
-rw-r--r-- | NetworkPkg/IpSecDxe/IpSecImpl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/NetworkPkg/IpSecDxe/IpSecImpl.c b/NetworkPkg/IpSecDxe/IpSecImpl.c index 63abfa6ba6..fe3a604ee4 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));
|