Fix a bug that Dhcp6CalculateLeaseTime() function use incorrect offset on the IaAddress pointer.

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
This commit is contained in:
Fu, Siyuan 2014-09-12 00:51:58 +00:00 committed by sfu5
parent 0164fc8e76
commit c99106b745
1 changed files with 2 additions and 4 deletions

View File

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