Revision: 14169
          http://edk2.svn.sourceforge.net/edk2/?rev=14169&view=rev
Author:   sfu5
Date:     2013-03-11 07:49:41 +0000 (Mon, 11 Mar 2013)
Log Message:
-----------
Update DHCP6 driver to handle EFI_DHCP6_CALLBACK return status correctly.
Signed-off-by: Fu Siyuan <[email protected]>
Reviewed-by: Ye Ting <[email protected]>
Reviewed-by: Ouyang Qian <[email protected]>

Modified Paths:
--------------
    trunk/edk2/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c

Modified: trunk/edk2/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c
===================================================================
--- trunk/edk2/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c    2013-03-11 07:47:42 UTC (rev 
14168)
+++ trunk/edk2/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c    2013-03-11 07:49:41 UTC (rev 
14169)
@@ -1,7 +1,7 @@
 /** @file
   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
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -2981,7 +2981,9 @@
           // 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 @@
       // 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 @@
       // 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 @@
 
  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 @@
     //
     // The failure of the others will terminate current state machine if 
timeout.
     //
-    Dhcp6CleanupSession (Instance, EFI_NO_RESPONSE);
+    Dhcp6CleanupSession (Instance, Status);
   }
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to