DPathNode->Ipv4.StaticIpAddress = \r
(BOOLEAN) (!Session->ConfigData.NvData.InitiatorInfoFromDhcp);\r
\r
- IP4_COPY_ADDRESS (\r
- &DPathNode->Ipv4.GatewayIpAddress,\r
- &Session->ConfigData.NvData.Gateway\r
- );\r
-\r
- IP4_COPY_ADDRESS (\r
- &DPathNode->Ipv4.SubnetMask,\r
- &Session->ConfigData.NvData.SubnetMask\r
- );\r
+ //\r
+ // Add a judgement here to support previous versions of IPv4_DEVICE_PATH.\r
+ // In previous versions of IPv4_DEVICE_PATH, GatewayIpAddress and SubnetMask\r
+ // do not exist.\r
+ // In new version of IPv4_DEVICE_PATH, structcure length is 27.\r
+ //\r
+ if (DevicePathNodeLength (&DPathNode->Ipv4) == IPv4_NODE_LEN_NEW_VERSIONS) { \r
+\r
+ IP4_COPY_ADDRESS (\r
+ &DPathNode->Ipv4.GatewayIpAddress,\r
+ &Session->ConfigData.NvData.Gateway\r
+ );\r
+\r
+ IP4_COPY_ADDRESS (\r
+ &DPathNode->Ipv4.SubnetMask,\r
+ &Session->ConfigData.NvData.SubnetMask\r
+ );\r
+ }\r
\r
break;\r
}\r
/** @file\r
Miscellaneous definitions for iSCSI driver.\r
\r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2015, 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
\r
typedef struct _ISCSI_SESSION_CONFIG_DATA ISCSI_SESSION_CONFIG_DATA;\r
\r
+///\r
+/// IPv4 Device Path Node Length\r
+///\r
+#define IPv4_NODE_LEN_NEW_VERSIONS 27\r
+\r
#pragma pack(1)\r
typedef struct {\r
BOOLEAN Enabled;\r