From b9f256bbe900626f0dd695ea2ccae21956564b88 Mon Sep 17 00:00:00 2001 From: sfu5 Date: Mon, 11 Mar 2013 07:49:41 +0000 Subject: Update DHCP6 driver to handle EFI_DHCP6_CALLBACK return status correctly. Signed-off-by: Fu Siyuan Reviewed-by: Ye Ting Reviewed-by: Ouyang Qian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14169 6f19259b-4bc3-4df7-8a09-765794883524 --- NetworkPkg/Dhcp6Dxe/Dhcp6Io.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'NetworkPkg/Dhcp6Dxe') diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c index 962d9387ca..1da31dcc54 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c @@ -1,7 +1,7 @@ /** @file Dhcp6 internal functions implementation. - Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -2981,7 +2981,9 @@ Dhcp6OnTimerTick ( // Select the advertisement received before. // Status = Dhcp6SelectAdvertiseMsg (Instance, Instance->AdSelect); - if (EFI_ERROR (Status)) { + if (Status == EFI_ABORTED) { + goto ON_CLOSE; + } else if (EFI_ERROR (Status)) { TxCb->RetryCnt++; } return; @@ -2997,6 +2999,7 @@ Dhcp6OnTimerTick ( // Check whether overflow the max retry count limit for this packet // if (TxCb->RetryCtl.Mrc != 0 && TxCb->RetryCtl.Mrc < TxCb->RetryCnt) { + Status = EFI_NO_RESPONSE; goto ON_CLOSE; } @@ -3004,6 +3007,7 @@ Dhcp6OnTimerTick ( // Check whether overflow the max retry duration for this packet // if (TxCb->RetryCtl.Mrd != 0 && TxCb->RetryCtl.Mrd <= TxCb->RetryLos) { + Status = EFI_NO_RESPONSE; goto ON_CLOSE; } @@ -3093,9 +3097,10 @@ Dhcp6OnTimerTick ( 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 == Dhcp6MsgConfirm + TxCb->TxPacket->Dhcp6.Header.MessageType == Dhcp6MsgConfirm) ) { // // 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. // - Dhcp6CleanupSession (Instance, EFI_NO_RESPONSE); + Dhcp6CleanupSession (Instance, Status); } } -- cgit v1.2.3