mirror of https://github.com/acidanthera/audk.git
MdeModulePkg: Add old IPv4_DEVICE_PATH support for new IScsiDxe
GatewayIpAddress and SubnetMask do not exist in old IPv4_DEVICE_PATH, this will lead new IScsiDxe to error if IPv4_DEVICE_PATH in system is not updated. Following UEFI2.5 spec of IPv4_DEVICE_PATH do a check before accessing fields only defined in new version, add a judgement here to make old IPv4_DEVICE_PATH and new IScsiDxe can cowork. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: fanwang2 <fan.wang@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> [lersek@redhat.com: rewrapped commit message] Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18057 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
42f0586d61
commit
7b0b360633
|
@ -814,15 +814,24 @@ IScsiGetTcpConnDevicePath (
|
||||||
DPathNode->Ipv4.StaticIpAddress =
|
DPathNode->Ipv4.StaticIpAddress =
|
||||||
(BOOLEAN) (!Session->ConfigData.NvData.InitiatorInfoFromDhcp);
|
(BOOLEAN) (!Session->ConfigData.NvData.InitiatorInfoFromDhcp);
|
||||||
|
|
||||||
IP4_COPY_ADDRESS (
|
//
|
||||||
&DPathNode->Ipv4.GatewayIpAddress,
|
// Add a judgement here to support previous versions of IPv4_DEVICE_PATH.
|
||||||
&Session->ConfigData.NvData.Gateway
|
// In previous versions of IPv4_DEVICE_PATH, GatewayIpAddress and SubnetMask
|
||||||
);
|
// do not exist.
|
||||||
|
// In new version of IPv4_DEVICE_PATH, structcure length is 27.
|
||||||
|
//
|
||||||
|
if (DevicePathNodeLength (&DPathNode->Ipv4) == IPv4_NODE_LEN_NEW_VERSIONS) {
|
||||||
|
|
||||||
IP4_COPY_ADDRESS (
|
IP4_COPY_ADDRESS (
|
||||||
&DPathNode->Ipv4.SubnetMask,
|
&DPathNode->Ipv4.GatewayIpAddress,
|
||||||
&Session->ConfigData.NvData.SubnetMask
|
&Session->ConfigData.NvData.Gateway
|
||||||
);
|
);
|
||||||
|
|
||||||
|
IP4_COPY_ADDRESS (
|
||||||
|
&DPathNode->Ipv4.SubnetMask,
|
||||||
|
&Session->ConfigData.NvData.SubnetMask
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Miscellaneous definitions for iSCSI driver.
|
Miscellaneous definitions for iSCSI driver.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -19,6 +19,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
typedef struct _ISCSI_SESSION_CONFIG_DATA ISCSI_SESSION_CONFIG_DATA;
|
typedef struct _ISCSI_SESSION_CONFIG_DATA ISCSI_SESSION_CONFIG_DATA;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// IPv4 Device Path Node Length
|
||||||
|
///
|
||||||
|
#define IPv4_NODE_LEN_NEW_VERSIONS 27
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
BOOLEAN Enabled;
|
BOOLEAN Enabled;
|
||||||
|
|
Loading…
Reference in New Issue