From nobody Sat Nov 2 10:35:27 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1491469068614323.81565550377115; Thu, 6 Apr 2017 01:57:48 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 374D921942329; Thu, 6 Apr 2017 01:57:47 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 241D721942322 for ; Thu, 6 Apr 2017 01:57:46 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Apr 2017 01:57:45 -0700 Received: from shwdeopenpsi116.ccr.corp.intel.com ([10.239.9.5]) by orsmga005.jf.intel.com with ESMTP; 06 Apr 2017 01:57:44 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491469066; x=1523005066; h=from:to:cc:subject:date:message-id; bh=YYps6V8INm0/DHmy4fkw3t4aXEXP5XG0r5aSHSjpvko=; b=eX3bEmL8lwVq2HD/x/ngWFB1Zn0ehgEvncLpW1DxXoWSRDJQiXqFllLa q9jC1XXEW+Vx0ZkVqiTwUq/YTX67rQ==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,283,1488873600"; d="scan'208";a="83824965" From: Zhang Lubo To: edk2-devel@lists.01.org Date: Thu, 6 Apr 2017 16:57:41 +0800 Message-Id: <1491469061-32796-1-git-send-email-lubo.zhang@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [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: , Cc: Ye Ting , Fu Siyuan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Need to check variable of mPrivate whether is null before used and redefine the array length of target address for keyword. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo Cc: Wu Jiaxin Cc: Ye Ting Cc: Fu Siyuan Reviewed-by: Jiaxin Wu Reviewed-by: Ye Ting =20 --- NetworkPkg/IScsiDxe/IScsiConfig.c | 30 ++++++++++++++----------= ---- NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiC= onfig.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_N= AME_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 + } } =20 /** Convert the IFR data to iSCSI configuration data. =20 diff --git a/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h b/NetworkPkg/IScs= iDxe/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]; --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel