]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix a bug that Dhcp6CalculateLeaseTime() function use incorrect offset on the IaAddre...
authorFu, Siyuan <siyuan.fu@intel.com>
Fri, 12 Sep 2014 00:51:58 +0000 (00:51 +0000)
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 12 Sep 2014 00:51:58 +0000 (00:51 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu, Siyuan <siyuan.fu@intel.com>
Reviewed-By: Ye, Ting (ting.ye@intel.com)
Reviewed-By: Wu, Jiaxin <jiaxin.wu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16097 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c

index 8603669903fb5acd6ea0651470eb08f4ec843e3c..5379d0d16a298893b7b5d07d27997ca5ea57ec40 100644 (file)
@@ -386,7 +386,6 @@ Dhcp6CalculateLeaseTime (
   IN DHCP6_IA_CB              *IaCb\r
   )\r
 {\r
-  EFI_DHCP6_IA_ADDRESS        *IaAddr;\r
   UINT32                      MinLt;\r
   UINT32                      MaxLt;\r
   UINTN                       Index;\r
@@ -401,9 +400,8 @@ Dhcp6CalculateLeaseTime (
   // valid life time.\r
   //\r
   for (Index = 0; Index < IaCb->Ia->IaAddressCount; Index++) {\r
-    IaAddr = IaCb->Ia->IaAddress + Index * sizeof (EFI_DHCP6_IA_ADDRESS);\r
-    MinLt  = MIN (MinLt, IaAddr->ValidLifetime);\r
-    MaxLt  = MAX (MinLt, IaAddr->ValidLifetime);\r
+    MinLt  = MIN (MinLt, IaCb->Ia->IaAddress[Index].ValidLifetime);\r
+    MaxLt  = MAX (MinLt, IaCb->Ia->IaAddress[Index].ValidLifetime);\r
   }\r
 \r
   //\r