]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IpSecDxe/IpSecImpl.c
1. In IPv4 and IPv6 driver, before calling IPsec, a new NET_FRAGMENT structure is...
[mirror_edk2.git] / NetworkPkg / IpSecDxe / IpSecImpl.c
index 63abfa6ba67f410ff6d841f8fd1a55200e0b0ddc..fe3a604ee4b5987e9bdf8f51917b2b31b05e97ff 100644 (file)
@@ -1596,7 +1596,7 @@ IpSecEspInboundPacket (
   //\r
   if (!SadData->Mode == EfiIPsecTunnel) {\r
     if (IpVersion == IP_VERSION_4) {\r
-      ((IP4_HEAD *) IpHead)->TotalLen = HTONS ((UINT16) (((IP4_HEAD *) IpHead)->HeadLen + PlainPayloadSize));\r
+      ((IP4_HEAD *) IpHead)->TotalLen = HTONS ((UINT16) ((((IP4_HEAD *) IpHead)->HeadLen << 2) + PlainPayloadSize));\r
     } else {\r
       IpSecHeadSize                              = IpSecGetPlainExtHeadSize (IpHead, LastHead);\r
       ((EFI_IP6_HEADER *) IpHead)->PayloadLength = HTONS ((UINT16)(IpSecHeadSize + PlainPayloadSize));\r