[edk2] [Patch v2 1/2] NetworkPkg/IScsiDxe: Fix the incorrect/needless DHCP process.

Jiaxin Wu posted 2 patches 7 years, 2 months ago
There is a newer version of this series
[edk2] [Patch v2 1/2] NetworkPkg/IScsiDxe: Fix the incorrect/needless DHCP process.
Posted by Jiaxin Wu 7 years, 2 months ago
The existing attempt should not trigger the DHCP process if it
doesn't associates with the current NIC. That's incorrect when
displaying the initiator info in attempt page.

Cc: Karunakar P <karunakarp@amiindia.co.in>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 NetworkPkg/IScsiDxe/IScsiMisc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
index efd05cf..0a0a3f5 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -1992,13 +1992,16 @@ IScsiGetConfigData (
                  AttemptTmp
                  );
 
           continue;
         }
-      } else if (AttemptTmp->SessionConfigData.InitiatorInfoFromDhcp && !AttemptTmp->ValidPath) {
+      } else if (AttemptTmp->SessionConfigData.InitiatorInfoFromDhcp && 
+                 !AttemptTmp->ValidPath && 
+                 AttemptTmp->NicIndex == mPrivate->CurrentNic) {
         //
-        // Get DHCP information for already added, but failed, attempt.
+        // If the attempt associates with the current NIC, we can 
+        // get DHCP information for already added, but failed, attempt.
         //
         AttemptTmp->DhcpSuccess = FALSE;
         if (!mPrivate->Ipv6Flag && (AttemptTmp->SessionConfigData.IpMode == IP_MODE_IP4)) {
           Status = IScsiDoDhcp (Private->Image, Private->Controller, AttemptTmp);
           if (!EFI_ERROR (Status)) {
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel