]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IScsiDxe/IScsiConfig.c
Fix some grammar and converge formatting of the two versions of TcpInput.c
[mirror_edk2.git] / NetworkPkg / IScsiDxe / IScsiConfig.c
index eea73a8ff15361a05806ae364f8fe665459f6f82..c6b48c651bbf28f13a43c97b32faf8e200abc1f8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Helper functions for configuring or getting the parameters relating to iSCSI.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -541,7 +541,24 @@ IScsiConvertIfrNvDataToAttemptConfigData (
           );\r
         return EFI_INVALID_PARAMETER;\r
       }\r
+\r
+      //\r
+      // Validate iSCSI target name configuration again:\r
+      // The format of iSCSI target name is already verified in IScsiFormCallback() when\r
+      // user input the name; here we only check the case user does not input the name.\r
+      //\r
+      if (Attempt->SessionConfigData.TargetName[0] == '\0') {\r
+        CreatePopUp (\r
+          EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
+          &Key,\r
+          L"iSCSI target name is NULL!",\r
+          NULL\r
+          );\r
+        return EFI_INVALID_PARAMETER;\r
+      }\r
     }\r
+\r
+\r
     //\r
     // Validate the authentication info.\r
     //\r
@@ -784,7 +801,7 @@ IScsiConvertIfrNvDataToAttemptConfigData (
     Status = gRT->SetVariable (\r
                     L"AttemptOrder",\r
                     &gIScsiConfigGuid,\r
-                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
+                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
                     AttemptConfigOrderSize,\r
                     AttemptConfigOrder\r
                     );\r
@@ -1246,8 +1263,7 @@ IScsiConfigDeleteAttempts (
     }\r
   }\r
 \r
-  Attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS\r
-              | EFI_VARIABLE_NON_VOLATILE;\r
+  Attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE;\r
 \r
   //\r
   // Update AttemptOrder in NVR.\r
@@ -1397,6 +1413,7 @@ IScsiConfigDisplayOrderAttempts (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
+  ASSERT (StartOpCodeHandle != NULL);\r
 \r
   OptionsOpCodeHandle = NULL;\r
 \r
@@ -1557,7 +1574,7 @@ IScsiConfigOrderAttempts (
   Status = gRT->SetVariable (\r
                   L"AttemptOrder",\r
                   &gIScsiConfigGuid,\r
-                  EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
+                  EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
                   AttemptConfigOrderSize,\r
                   AttemptConfigOrderTmp\r
                   );\r
@@ -2355,7 +2372,7 @@ IScsiFormCallback (
           &Key,\r
           L"Invalid iSCSI Name!",\r
           NULL\r
-          );       \r
+          );\r
       } else {\r
         AsciiStrCpy (Private->Current->SessionConfigData.TargetName, IScsiName);\r
       }\r