NetworkPkg: Add old IPv4_DEVICE_PATH and IPv6_DEVICE_PATH support

GatewayIpAddress and SubnetMask do not exist in old IPv4_DEVICE_PATH,
IPAddressOrigin, PrefixLength and GatewayIPAddress do not exist in old
IPv6_DEVICE_PATH. This will lead new IScsiDxe to error without updating
IPv4_DEVICE_PATH and IPv6_DEVICE_PATH in system.

Following UEFI2.5 spec of IPv4_DEVICE_PATH do a check before accessing
fields only defined in new version's IPv4_DEVICE_PATH, and revise the same
issue for IPv6_DEVICE_PATH in Iscsi driver.

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@18056 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
fanwang2
2015-07-26 08:03:59 +00:00
committed by jljusten
parent f18b2162e8
commit 42f0586d61
2 changed files with 67 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
/** @file
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
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
@@ -17,6 +17,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
typedef struct _ISCSI_DRIVER_DATA ISCSI_DRIVER_DATA;
///
/// IPv4 Device Path Node Length
///
#define IPv4_NODE_LEN_NEW_VERSIONS 27
///
/// IPv6 Device Path Node Length
///
#define IPv6_NODE_LEN_OLD_VERSIONS 43
#define IPv6_NODE_LEN_NEW_VERSIONS 60
///
/// The ignored field StaticIpAddress's offset in old IPv6 Device Path
///
#define IPv6_OLD_IPADDRESS_OFFSET 42;
#pragma pack(1)
typedef struct _ISCSI_SESSION_CONFIG_NVDATA {
UINT16 TargetPort;