]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IScsiDxe/IScsiMisc.c
Adopt new IPv4/IPv6 device path for network modules.
[mirror_edk2.git] / NetworkPkg / IScsiDxe / IScsiMisc.c
index a697659f49e9805d8b708e5c1cbfd4c3ee1753cf..f3ecdb5f6a1de4d24e6994bd944cc669c382b77e 100644 (file)
@@ -297,7 +297,7 @@ IScsiMacAddrToStr (
   for (Index = 0; Index < Len; Index++) {\r
     Str[3 * Index]      = (CHAR16) IScsiHexString[(Mac->Addr[Index] >> 4) & 0x0F];\r
     Str[3 * Index + 1]  = (CHAR16) IScsiHexString[Mac->Addr[Index] & 0x0F];\r
-    Str[3 * Index + 2]  = L'-';\r
+    Str[3 * Index + 2]  = L':';\r
   }\r
 \r
   String = &Str[3 * Index - 1] ;\r
@@ -640,6 +640,14 @@ IScsiRemoveNic (
     }\r
   }\r
 \r
+  //\r
+  // Free attempt is created but not saved to system.\r
+  //\r
+  if (mPrivate->NewAttempt != NULL) {\r
+    FreePool (mPrivate->NewAttempt);\r
+    mPrivate->NewAttempt = NULL;\r
+  }\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -913,7 +921,7 @@ IScsiGetConfigData (
   //\r
   AttemptConfigOrder = IScsiGetVariableAndSize (\r
                          L"AttemptOrder",\r
-                         &mVendorGuid,\r
+                         &gIScsiConfigGuid,\r
                          &AttemptConfigOrderSize\r
                          );\r
   if (AttemptConfigOrder == NULL || AttemptConfigOrderSize == 0) {\r
@@ -1279,11 +1287,25 @@ IScsiGetTcpConnDevicePath (
     if (DevicePathType (&DPathNode->DevPath) == MESSAGING_DEVICE_PATH) {\r
       if (!Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv4_DP) {\r
         DPathNode->Ipv4.LocalPort       = 0;\r
-        DPathNode->Ipv4.StaticIpAddress = (BOOLEAN) !Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp;\r
+\r
+        DPathNode->Ipv4.StaticIpAddress = \r
+          (BOOLEAN) (!Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp);\r
+\r
+        IP4_COPY_ADDRESS (\r
+          &DPathNode->Ipv4.GatewayIpAddress,\r
+          &Session->ConfigData->SessionConfigData.Gateway\r
+          );\r
+\r
+        IP4_COPY_ADDRESS (\r
+          &DPathNode->Ipv4.SubnetMask,\r
+          &Session->ConfigData->SessionConfigData.SubnetMask\r
+          );\r
         break;\r
       } else if (Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv6_DP) {\r
         DPathNode->Ipv6.LocalPort       = 0;\r
-        DPathNode->Ipv6.StaticIpAddress = (BOOLEAN) !Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp;\r
+        DPathNode->Ipv6.IpAddressOrigin = 0;\r
+        DPathNode->Ipv6.PrefixLength    = IP6_PREFIX_LENGTH;\r
+        ZeroMem (&DPathNode->Ipv6.GatewayIpAddress, sizeof (EFI_IPv6_ADDRESS));\r
         break;\r
       }\r
     }\r