summaryrefslogtreecommitdiff
path: root/NetworkPkg/IScsiDxe/IScsiProto.c
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg/IScsiDxe/IScsiProto.c')
-rw-r--r--NetworkPkg/IScsiDxe/IScsiProto.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiProto.c b/NetworkPkg/IScsiDxe/IScsiProto.c
index 5092365..88d9bdd 100644
--- a/NetworkPkg/IScsiDxe/IScsiProto.c
+++ b/NetworkPkg/IScsiDxe/IScsiProto.c
@@ -1069,12 +1069,13 @@ IScsiUpdateTargetAddress (
IN UINT32 Len
)
{
- LIST_ENTRY *KeyValueList;
- CHAR8 *TargetAddress;
- CHAR8 *IpStr;
- EFI_STATUS Status;
- UINTN Number;
- UINT8 IpMode;
+ LIST_ENTRY *KeyValueList;
+ CHAR8 *TargetAddress;
+ CHAR8 *IpStr;
+ EFI_STATUS Status;
+ UINTN Number;
+ UINT8 IpMode;
+ ISCSI_SESSION_CONFIG_NVDATA *NvData;
KeyValueList = IScsiBuildKeyValueList (Data, Len);
if (KeyValueList == NULL) {
@@ -1082,7 +1083,8 @@ IScsiUpdateTargetAddress (
}
Status = EFI_NOT_FOUND;
-
+ NvData = &Session->ConfigData->SessionConfigData;
+
while (TRUE) {
TargetAddress = IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_TARGET_ADDRESS);
if (TargetAddress == NULL) {
@@ -1098,6 +1100,11 @@ IScsiUpdateTargetAddress (
continue;
}
+ //
+ // Save the origial user setting which specifies the proxy/virtual iSCSI target.
+ //
+ NvData->OriginalTargetPort = NvData->TargetPort;
+
IpStr = TargetAddress;
while ((*TargetAddress != 0) && (*TargetAddress != ':') && (*TargetAddress != ',')) {
@@ -1122,19 +1129,25 @@ IScsiUpdateTargetAddress (
if (Number > 0xFFFF) {
continue;
} else {
- Session->ConfigData->SessionConfigData.TargetPort = (UINT16) Number;
+ NvData->TargetPort = (UINT16) Number;
}
} else {
//
// The string only contains the IPv4 address. Use the well-known port.
//
- Session->ConfigData->SessionConfigData.TargetPort = ISCSI_WELL_KNOWN_PORT;
+ NvData->TargetPort = ISCSI_WELL_KNOWN_PORT;
}
+
+ //
+ // Save the origial user setting which specifies the proxy/virtual iSCSI target.
+ //
+ CopyMem (&NvData->OriginalTargetIp, &NvData->TargetIp, sizeof (EFI_IP_ADDRESS));
+
//
// Update the target IP address.
//
- if (Session->ConfigData->SessionConfigData.IpMode < IP_MODE_AUTOCONFIG) {
- IpMode = Session->ConfigData->SessionConfigData.IpMode;
+ if (NvData->IpMode < IP_MODE_AUTOCONFIG) {
+ IpMode = NvData->IpMode;
} else {
IpMode = Session->ConfigData->AutoConfigureMode;
}
@@ -1148,6 +1161,7 @@ IScsiUpdateTargetAddress (
if (EFI_ERROR (Status)) {
continue;
} else {
+ NvData->RedirectFlag = TRUE;
break;
}
}