]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update DHCP6 driver to handle EFI_DHCP6_CALLBACK return status correctly.
authorsfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 11 Mar 2013 07:49:41 +0000 (07:49 +0000)
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 11 Mar 2013 07:49:41 +0000 (07:49 +0000)
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

NetworkPkg/Dhcp6Dxe/Dhcp6Io.c

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