Update DHCP6 driver to handle EFI_DHCP6_CALLBACK return status correctly.

Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Ouyang Qian <qian.ouyang@intel.com>


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14169 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
sfu5 2013-03-11 07:49:41 +00:00
parent f402291bf9
commit b9f256bbe9
1 changed files with 10 additions and 5 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
Dhcp6 internal functions implementation. Dhcp6 internal functions implementation.
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -2981,7 +2981,9 @@ Dhcp6OnTimerTick (
// Select the advertisement received before. // Select the advertisement received before.
// //
Status = Dhcp6SelectAdvertiseMsg (Instance, Instance->AdSelect); Status = Dhcp6SelectAdvertiseMsg (Instance, Instance->AdSelect);
if (EFI_ERROR (Status)) { if (Status == EFI_ABORTED) {
goto ON_CLOSE;
} else if (EFI_ERROR (Status)) {
TxCb->RetryCnt++; TxCb->RetryCnt++;
} }
return; return;
@ -2997,6 +2999,7 @@ Dhcp6OnTimerTick (
// Check whether overflow the max retry count limit for this packet // Check whether overflow the max retry count limit for this packet
// //
if (TxCb->RetryCtl.Mrc != 0 && TxCb->RetryCtl.Mrc < TxCb->RetryCnt) { if (TxCb->RetryCtl.Mrc != 0 && TxCb->RetryCtl.Mrc < TxCb->RetryCnt) {
Status = EFI_NO_RESPONSE;
goto ON_CLOSE; goto ON_CLOSE;
} }
@ -3004,6 +3007,7 @@ Dhcp6OnTimerTick (
// Check whether overflow the max retry duration for this packet // Check whether overflow the max retry duration for this packet
// //
if (TxCb->RetryCtl.Mrd != 0 && TxCb->RetryCtl.Mrd <= TxCb->RetryLos) { if (TxCb->RetryCtl.Mrd != 0 && TxCb->RetryCtl.Mrd <= TxCb->RetryLos) {
Status = EFI_NO_RESPONSE;
goto ON_CLOSE; goto ON_CLOSE;
} }
@ -3093,9 +3097,10 @@ Dhcp6OnTimerTick (
ON_CLOSE: ON_CLOSE:
if (TxCb->TxPacket->Dhcp6.Header.MessageType == Dhcp6MsgInfoRequest || if (TxCb->TxPacket != NULL &&
(TxCb->TxPacket->Dhcp6.Header.MessageType == Dhcp6MsgInfoRequest ||
TxCb->TxPacket->Dhcp6.Header.MessageType == Dhcp6MsgRenew || TxCb->TxPacket->Dhcp6.Header.MessageType == Dhcp6MsgRenew ||
TxCb->TxPacket->Dhcp6.Header.MessageType == Dhcp6MsgConfirm TxCb->TxPacket->Dhcp6.Header.MessageType == Dhcp6MsgConfirm)
) { ) {
// //
// The failure of renew/Confirm will still switch to the bound state. // The failure of renew/Confirm will still switch to the bound state.
@ -3120,6 +3125,6 @@ Dhcp6OnTimerTick (
// //
// The failure of the others will terminate current state machine if timeout. // The failure of the others will terminate current state machine if timeout.
// //
Dhcp6CleanupSession (Instance, EFI_NO_RESPONSE); Dhcp6CleanupSession (Instance, Status);
} }
} }