diff options
author | Fu, Siyuan <siyuan.fu@intel.com> | 2014-09-12 00:51:58 +0000 |
---|---|---|
committer | sfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-09-12 00:51:58 +0000 |
commit | c99106b745ccb2c7b66b50117b594eb1a942d4fb (patch) | |
tree | 84a07680bbb1f99ad85bbeb4431f1eb7e6f75ec6 | |
parent | 0164fc8e76b6ca9023c893940ddb00ef0b6bee5a (diff) | |
download | edk2-c99106b745ccb2c7b66b50117b594eb1a942d4fb.zip edk2-c99106b745ccb2c7b66b50117b594eb1a942d4fb.tar.gz edk2-c99106b745ccb2c7b66b50117b594eb1a942d4fb.tar.bz2 |
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
-rw-r--r-- | NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c index 8603669..5379d0d 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c @@ -386,7 +386,6 @@ Dhcp6CalculateLeaseTime ( IN DHCP6_IA_CB *IaCb
)
{
- EFI_DHCP6_IA_ADDRESS *IaAddr;
UINT32 MinLt;
UINT32 MaxLt;
UINTN Index;
@@ -401,9 +400,8 @@ Dhcp6CalculateLeaseTime ( // valid life time.
//
for (Index = 0; Index < IaCb->Ia->IaAddressCount; Index++) {
- IaAddr = IaCb->Ia->IaAddress + Index * sizeof (EFI_DHCP6_IA_ADDRESS);
- MinLt = MIN (MinLt, IaAddr->ValidLifetime);
- MaxLt = MAX (MinLt, IaAddr->ValidLifetime);
+ MinLt = MIN (MinLt, IaCb->Ia->IaAddress[Index].ValidLifetime);
+ MaxLt = MAX (MinLt, IaCb->Ia->IaAddress[Index].ValidLifetime);
}
//
|