From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6F8EB21A18AAB for ; Tue, 11 Apr 2017 05:01:30 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2017 05:01:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,185,1488873600"; d="scan'208";a="72519093" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga002.jf.intel.com with ESMTP; 11 Apr 2017 05:01:29 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 11 Apr 2017 05:01:29 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 11 Apr 2017 05:01:29 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by shsmsx102.ccr.corp.intel.com ([169.254.2.246]) with mapi id 14.03.0319.002; Tue, 11 Apr 2017 20:01:25 +0800 From: "Wu, Jiaxin" To: "Zhang, Lubo" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" Thread-Topic: [patch] NetworkPkg: Add check logic for iSCSI driver. Thread-Index: AQHSrrPoilHksWNPSku6fR4CWhvL46HAGTlw Date: Tue, 11 Apr 2017 12:01:24 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B7274162BF6D2@SHSMSX103.ccr.corp.intel.com> References: <1491469061-32796-1-git-send-email-lubo.zhang@intel.com> In-Reply-To: <1491469061-32796-1-git-send-email-lubo.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWY0OTVmZWYtZjYwMS00NDY5LTg3MmUtNzVkNDQzZTZiNWQ5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkhrREtvZ2I3ekQwWU9MTWt1M0hYdjZHMVNRUVZBTm8yYzgzSDJpaGZzNjg9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] NetworkPkg: Add check logic for iSCSI driver. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 12:01:30 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiaxin Wu Thanks, Jiaxin > -----Original Message----- > From: Zhang, Lubo > Sent: Thursday, April 6, 2017 4:58 PM > To: edk2-devel@lists.01.org > Cc: Wu, Jiaxin ; Ye, Ting ; Fu, > Siyuan > Subject: [patch] NetworkPkg: Add check logic for iSCSI driver. >=20 > Need to check variable of mPrivate whether is > null before used and redefine the array length > of target address for keyword. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Zhang Lubo > Cc: Wu Jiaxin > Cc: Ye Ting > Cc: Fu Siyuan > --- > NetworkPkg/IScsiDxe/IScsiConfig.c | 30 ++++++++++++++--------= ------ > NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h | 2 +- > 2 files changed, 16 insertions(+), 16 deletions(-) >=20 > diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c > b/NetworkPkg/IScsiDxe/IScsiConfig.c > index 56a8685..a588403 100644 > --- a/NetworkPkg/IScsiDxe/IScsiConfig.c > +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c > @@ -742,28 +742,28 @@ > IScsiConvertAttemptConfigDataToIfrNvDataByKeyword ( > ISCSI_CHAP_SECRET_STORAGE > ); > } > } > CopyMem(IfrNvData->ISCSIDisplayAttemptList, AttemptNameList, > ATTEMPT_NAME_LIST_SIZE); > - } >=20 > - NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) { > - NicInfo =3D NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link); > - IScsiMacAddrToStr ( > - &NicInfo->PermanentAddress, > - NicInfo->HwAddressSize, > - NicInfo->VlanId, > - MacString > - ); > - CopyMem ( > - IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr), > - MacString, > - StrLen (MacString) * sizeof (CHAR16) > + NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) { > + NicInfo =3D NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link); > + IScsiMacAddrToStr ( > + &NicInfo->PermanentAddress, > + NicInfo->HwAddressSize, > + NicInfo->VlanId, > + MacString > ); > + CopyMem ( > + IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr), > + MacString, > + StrLen (MacString) * sizeof (CHAR16) > + ); >=20 > - *(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) =3D L'= /'; > - } > + *(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) =3D = L'/'; > + } > + } > } >=20 > /** > Convert the IFR data to iSCSI configuration data. >=20 > diff --git a/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h > b/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h > index f89f320..22119ad 100644 > --- a/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h > +++ b/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h > @@ -160,11 +160,11 @@ typedef struct { > CHAR16 ISCSIIsId[ISID_CONFIGURABLE_STORAGE]; > CHAR16 ISCSIInitiatorIpAddress[IP4_STR_MAX_SIZE]; > CHAR16 ISCSIInitiatorNetmask[IP4_STR_MAX_SIZE]; > CHAR16 ISCSIInitiatorGateway[IP4_STR_MAX_SIZE]; > CHAR16 ISCSITargetName[ISCSI_NAME_MAX_SIZE]; > - CHAR16 ISCSITargetIpAddress[IP_STR_MAX_SIZE]; > + CHAR16 ISCSITargetIpAddress[ISCSI_TARGET_URI_MAX_SIZE]; > CHAR16 ISCSILun[ISCSI_LUN_STR_MAX_LEN]; > CHAR16 ISCSIChapUsername[ISCSI_CHAP_NAME_STORAGE]; > CHAR16 ISCSIChapSecret[ISCSI_CHAP_SECRET_STORAGE]; > CHAR16 ISCSIReverseChapUsername[ISCSI_CHAP_NAME_STORAGE]; > CHAR16 ISCSIReverseChapSecret[ISCSI_CHAP_SECRET_STORAGE]; > -- > 1.9.5.msysgit.1