]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c
fixed IP fragment issue which caused the MTU used by IP is less than the one IP expos...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Output.c
index a8a6261cfd4203c444f0703145a0fdd58d6ad628..7d8745d5a5b2208ef410f4c45c5dd28821a9a2ff 100644 (file)
@@ -73,7 +73,7 @@ Ip4PrependHead (
   PacketHead->Ver       = 4;\r
   PacketHead->HeadLen   = (UINT8) (HeadLen >> 2);\r
   PacketHead->Tos       = Head->Tos;\r
-  PacketHead->TotalLen  = HTONS (Packet->TotalSize);\r
+  PacketHead->TotalLen  = HTONS ((UINT16) Packet->TotalSize);\r
   PacketHead->Id        = HTONS (Head->Id);\r
   PacketHead->Fragment  = HTONS (Head->Fragment);\r
   PacketHead->Checksum  = 0;\r
@@ -311,11 +311,8 @@ Ip4Output (
   //\r
   // OK, selected the source and route, fragment the packet then send\r
   // them. Tag each fragment other than the first one as spawn from it.\r
-\r
-  //\r
-  // IPsec payload has been appended, so use IpSb->SnpMode.MaxPacketSize here.\r
   //\r
-  Mtu            = IpSb->SnpMode.MaxPacketSize;\r
+  Mtu            = IpSb->MaxPacketSize + sizeof (IP4_HEAD);\r
   HeadLen        = sizeof (IP4_HEAD) + ((OptLen + 3) & (~0x03));\r
   Head->Id       = mIp4Id++;\r
 \r