From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 A1FFD81EE0 for ; Mon, 27 Feb 2017 19:02:59 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2017 19:02:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,217,1484035200"; d="scan'208";a="69790111" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 27 Feb 2017 19:02:58 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 27 Feb 2017 19:02:58 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by shsmsx102.ccr.corp.intel.com ([169.254.2.88]) with mapi id 14.03.0248.002; Tue, 28 Feb 2017 11:02:54 +0800 From: "Wu, Jiaxin" To: "Zhang, Lubo" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" Thread-Topic: [PATCH V2] NetworkPkg: Add check logic for some variable in iSCSI driver. Thread-Index: AQHSkNlyOwlkntDYJ0e89UTOAEk5JKF9vAjA Date: Tue, 28 Feb 2017 03:02:53 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B72741629EAE8@SHSMSX103.ccr.corp.intel.com> References: <1488186629-6072-1-git-send-email-lubo.zhang@intel.com> In-Reply-To: <1488186629-6072-1-git-send-email-lubo.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTkyNDk5MzYtZTdhMy00ZTRjLTlkNzQtMmYyODkxM2U3NTRkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS45LjYuNiIsIlRydXN0ZWRMYWJlbEhhc2giOiIwdUI1aUVCUTVLMjVGVHpROWxrcVA4MEh3bXErc2FOR1Q4Q21IK0xsVCtVPSJ9 x-ctpclassification: CTP_PUBLIC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH V2] NetworkPkg: Add check logic for some variable in iSCSI driver. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 03:02:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Lubo, In IScsiConfigProcessDefault, we'd better replace the ASSERT for AttemptCon= figOrder/AttemptConfigData with "if error" condition. Others is good to me. Reviewed-by: Wu Jiaxin Thanks, Jiaxin > -----Original Message----- > From: Zhang, Lubo > Sent: Monday, February 27, 2017 5:10 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Wu, > Jiaxin > Subject: [PATCH V2] NetworkPkg: Add check logic for some variable in iSCS= I > driver. >=20 > v2: need to check the global variable mPrivate before using it in > the Convert AttemptConfigData To IfrNvData by Keyword function. >=20 > Add check logic for some attempt variable to enhance code in iSCSI. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Zhang Lubo > Cc: Ye Ting > Cc: Fu Siyuan > Cc: Wu Jiaxin > --- > NetworkPkg/IScsiDxe/IScsiConfig.c | 271 ++++++++++++++++++++----------- > ------- > NetworkPkg/IScsiDxe/IScsiConfig.h | 2 +- > 2 files changed, 143 insertions(+), 130 deletions(-) >=20 > diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c > b/NetworkPkg/IScsiDxe/IScsiConfig.c > index b169620..08a49d6 100644 > --- a/NetworkPkg/IScsiDxe/IScsiConfig.c > +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c > @@ -628,116 +628,123 @@ > IScsiConvertAttemptConfigDataToIfrNvDataByKeyword ( > ISCSI_SESSION_CONFIG_NVDATA *SessionConfigData; > ISCSI_CHAP_AUTH_CONFIG_NVDATA *AuthConfigData; > CHAR16 AttemptNameList[ATTEMPT_NAME_LIST_SIZE]; > EFI_IP_ADDRESS Ip; > UINTN Index; > + UINTN StringLen; >=20 > ZeroMem (AttemptNameList, sizeof (AttemptNameList)); >=20 > - NET_LIST_FOR_EACH (Entry, &mPrivate->AttemptConfigs) { > - Attempt =3D NET_LIST_USER_STRUCT (Entry, > ISCSI_ATTEMPT_CONFIG_NVDATA, Link); > - // > - // Normal session configuration parameters. > - // > - SessionConfigData =3D &Attempt->SessionConfigData; > - > - Index =3D Attempt->AttemptConfigIndex - 1; > + if ((mPrivate !=3D NULL) && (mPrivate->AttemptCount !=3D 0)) { > + NET_LIST_FOR_EACH (Entry, &mPrivate->AttemptConfigs) { > + Attempt =3D NET_LIST_USER_STRUCT (Entry, > ISCSI_ATTEMPT_CONFIG_NVDATA, Link); > + // > + // Normal session configuration parameters. > + // > + SessionConfigData =3D &Attempt->SessionConfigData; >=20 > - // > - // Save the attempt to AttemptNameList as Attempt:1 Attempt:2 > - // > - AsciiStrToUnicodeStrS ( > - Attempt->AttemptName, > - AttemptNameList + StrLen (AttemptNameList), > - ATTEMPT_NAME_LIST_SIZE > - ); > - *(AttemptNameList + StrLen (AttemptNameList) - 2) =3D L':'; > - *(AttemptNameList + StrLen (AttemptNameList)) =3D L' '; > + ASSERT ((Attempt->AttemptConfigIndex > 0) && (Attempt- > >AttemptConfigIndex <=3D FixedPcdGet8 (PcdMaxIScsiAttemptNumber))); > + Index =3D Attempt->AttemptConfigIndex - 1; >=20 > - AsciiStrToUnicodeStrS ( > - Attempt->AttemptName, > - IfrNvData->ISCSIAttemptName + ATTEMPT_NAME_SIZE * Index, > - ATTEMPT_NAME_SIZE > - ); > + // > + // Save the attempt to AttemptNameList as Attempt:1 Attempt:2 > + // > + AsciiStrToUnicodeStrS ( > + Attempt->AttemptName, > + AttemptNameList + StrLen (AttemptNameList), > + ATTEMPT_NAME_LIST_SIZE - StrLen (AttemptNameList) > + ); >=20 > - IfrNvData->ISCSIBootEnableList[Index] =3D SessionConfigData= ->Enabled; > - IfrNvData->ISCSIIpAddressTypeList[Index] =3D SessionConfigData= - > >IpMode; > + StringLen =3D StrLen (AttemptNameList); > + ASSERT (StringLen > 2); > + *(AttemptNameList + StringLen - 2) =3D L':'; > + *(AttemptNameList + StringLen) =3D L' '; >=20 > - IfrNvData->ISCSIInitiatorInfoViaDHCP[Index] =3D SessionConfigData= - > >InitiatorInfoFromDhcp; > - IfrNvData->ISCSITargetInfoViaDHCP[Index] =3D SessionConfigData= - > >TargetInfoFromDhcp; > - IfrNvData->ISCSIConnectRetry[Index] =3D SessionConfigData= - > >ConnectRetryCount; > - IfrNvData->ISCSIConnectTimeout[Index] =3D SessionConfigData= - > >ConnectTimeout; > - IfrNvData->ISCSITargetTcpPort[Index] =3D SessionConfigData= - > >TargetPort; > + AsciiStrToUnicodeStrS ( > + Attempt->AttemptName, > + IfrNvData->ISCSIAttemptName + ATTEMPT_NAME_SIZE * Index, > + ATTEMPT_NAME_LIST_SIZE - ATTEMPT_NAME_SIZE * Index > + ); >=20 > - if (SessionConfigData->IpMode =3D=3D IP_MODE_IP4) { > - CopyMem (&Ip.v4, &SessionConfigData->LocalIp, sizeof > (EFI_IPv4_ADDRESS)); > - IScsiIpToStr (&Ip, FALSE, IfrNvData- > >Keyword[Index].ISCSIInitiatorIpAddress); > - CopyMem (&Ip.v4, &SessionConfigData->SubnetMask, sizeof > (EFI_IPv4_ADDRESS)); > - IScsiIpToStr (&Ip, FALSE, IfrNvData- > >Keyword[Index].ISCSIInitiatorNetmask); > - CopyMem (&Ip.v4, &SessionConfigData->Gateway, sizeof > (EFI_IPv4_ADDRESS)); > - IScsiIpToStr (&Ip, FALSE, IfrNvData- > >Keyword[Index].ISCSIInitiatorGateway); > - if (SessionConfigData->TargetIp.v4.Addr[0] !=3D '\0') { > - CopyMem (&Ip.v4, &SessionConfigData->TargetIp, sizeof > (EFI_IPv4_ADDRESS)); > - IScsiIpToStr (&Ip, FALSE, IfrNvData- > >Keyword[Index].ISCSITargetIpAddress); > - } > - } else if (SessionConfigData->IpMode =3D=3D IP_MODE_IP6) { > - ZeroMem (IfrNvData->Keyword[Index].ISCSITargetIpAddress, sizeof > (IfrNvData->TargetIp)); > - if (SessionConfigData->TargetIp.v6.Addr[0] !=3D '\0') { > - IP6_COPY_ADDRESS (&Ip.v6, &SessionConfigData->TargetIp); > - IScsiIpToStr (&Ip, TRUE, IfrNvData- > >Keyword[Index].ISCSITargetIpAddress); > + IfrNvData->ISCSIBootEnableList[Index] =3D SessionConfigDa= ta- > >Enabled; > + IfrNvData->ISCSIIpAddressTypeList[Index] =3D SessionConfigDa= ta- > >IpMode; > + > + IfrNvData->ISCSIInitiatorInfoViaDHCP[Index] =3D SessionConfigDa= ta- > >InitiatorInfoFromDhcp; > + IfrNvData->ISCSITargetInfoViaDHCP[Index] =3D SessionConfigDa= ta- > >TargetInfoFromDhcp; > + IfrNvData->ISCSIConnectRetry[Index] =3D SessionConfigDa= ta- > >ConnectRetryCount; > + IfrNvData->ISCSIConnectTimeout[Index] =3D SessionConfigDa= ta- > >ConnectTimeout; > + IfrNvData->ISCSITargetTcpPort[Index] =3D SessionConfigDa= ta- > >TargetPort; > + > + if (SessionConfigData->IpMode =3D=3D IP_MODE_IP4) { > + CopyMem (&Ip.v4, &SessionConfigData->LocalIp, sizeof > (EFI_IPv4_ADDRESS)); > + IScsiIpToStr (&Ip, FALSE, IfrNvData- > >Keyword[Index].ISCSIInitiatorIpAddress); > + CopyMem (&Ip.v4, &SessionConfigData->SubnetMask, sizeof > (EFI_IPv4_ADDRESS)); > + IScsiIpToStr (&Ip, FALSE, IfrNvData- > >Keyword[Index].ISCSIInitiatorNetmask); > + CopyMem (&Ip.v4, &SessionConfigData->Gateway, sizeof > (EFI_IPv4_ADDRESS)); > + IScsiIpToStr (&Ip, FALSE, IfrNvData- > >Keyword[Index].ISCSIInitiatorGateway); > + if (SessionConfigData->TargetIp.v4.Addr[0] !=3D '\0') { > + CopyMem (&Ip.v4, &SessionConfigData->TargetIp, sizeof > (EFI_IPv4_ADDRESS)); > + IScsiIpToStr (&Ip, FALSE, IfrNvData- > >Keyword[Index].ISCSITargetIpAddress); > + } > + } else if (SessionConfigData->IpMode =3D=3D IP_MODE_IP6) { > + ZeroMem (IfrNvData->Keyword[Index].ISCSITargetIpAddress, sizeof > (IfrNvData->TargetIp)); > + if (SessionConfigData->TargetIp.v6.Addr[0] !=3D '\0') { > + IP6_COPY_ADDRESS (&Ip.v6, &SessionConfigData->TargetIp); > + IScsiIpToStr (&Ip, TRUE, IfrNvData- > >Keyword[Index].ISCSITargetIpAddress); > + } > } > - } >=20 > - AsciiStrToUnicodeStrS ( > - SessionConfigData->TargetName, > - IfrNvData->Keyword[Index].ISCSITargetName, > - ISCSI_NAME_MAX_SIZE > - ); > - > - if (SessionConfigData->DnsMode) { > AsciiStrToUnicodeStrS ( > - SessionConfigData->TargetUrl, > - IfrNvData->TargetIp, > - sizeof (IfrNvData->TargetIp) / sizeof (IfrNvData->TargetIp[0]) > + SessionConfigData->TargetName, > + IfrNvData->Keyword[Index].ISCSITargetName, > + ISCSI_NAME_MAX_SIZE > ); > - } >=20 > - IScsiLunToUnicodeStr (SessionConfigData->BootLun, IfrNvData- > >Keyword[Index].ISCSILun); > - IScsiConvertIsIdToString (IfrNvData->Keyword[Index].ISCSIIsId, > SessionConfigData->IsId); > + if (SessionConfigData->DnsMode) { > + AsciiStrToUnicodeStrS ( > + SessionConfigData->TargetUrl, > + IfrNvData->TargetIp, > + sizeof (IfrNvData->TargetIp) / sizeof (IfrNvData->TargetIp[0]) > + ); > + } >=20 > - IfrNvData->ISCSIAuthenticationMethod[Index] =3D Attempt- > >AuthenticationType; > + IScsiLunToUnicodeStr (SessionConfigData->BootLun, IfrNvData- > >Keyword[Index].ISCSILun); > + IScsiConvertIsIdToString (IfrNvData->Keyword[Index].ISCSIIsId, > SessionConfigData->IsId); >=20 > - if (Attempt->AuthenticationType =3D=3D ISCSI_AUTH_TYPE_CHAP) { > - AuthConfigData =3D &Attempt->AuthConfigData.CHAP; > - IfrNvData->ISCSIChapType[Index] =3D AuthConfigData->CHAPType; > - AsciiStrToUnicodeStrS ( > - AuthConfigData->CHAPName, > - IfrNvData->Keyword[Index].ISCSIChapUsername, > - ISCSI_CHAP_NAME_STORAGE > - ); > + IfrNvData->ISCSIAuthenticationMethod[Index] =3D Attempt- > >AuthenticationType; >=20 > - AsciiStrToUnicodeStrS ( > - AuthConfigData->CHAPSecret, > - IfrNvData->Keyword[Index].ISCSIChapSecret, > - ISCSI_CHAP_SECRET_STORAGE > - ); > + if (Attempt->AuthenticationType =3D=3D ISCSI_AUTH_TYPE_CHAP) { > + AuthConfigData =3D &Attempt->AuthConfigData.CHAP; > + IfrNvData->ISCSIChapType[Index] =3D AuthConfigData->CHAPType; > + AsciiStrToUnicodeStrS ( > + AuthConfigData->CHAPName, > + IfrNvData->Keyword[Index].ISCSIChapUsername, > + ISCSI_CHAP_NAME_STORAGE > + ); >=20 > - AsciiStrToUnicodeStrS ( > - AuthConfigData->ReverseCHAPName, > - IfrNvData->Keyword[Index].ISCSIReverseChapUsername, > - ISCSI_CHAP_NAME_STORAGE > - ); > + AsciiStrToUnicodeStrS ( > + AuthConfigData->CHAPSecret, > + IfrNvData->Keyword[Index].ISCSIChapSecret, > + ISCSI_CHAP_SECRET_STORAGE > + ); >=20 > - AsciiStrToUnicodeStrS ( > - AuthConfigData->ReverseCHAPSecret, > - IfrNvData->Keyword[Index].ISCSIReverseChapSecret, > - ISCSI_CHAP_SECRET_STORAGE > - ); > + AsciiStrToUnicodeStrS ( > + AuthConfigData->ReverseCHAPName, > + IfrNvData->Keyword[Index].ISCSIReverseChapUsername, > + ISCSI_CHAP_NAME_STORAGE > + ); > + > + AsciiStrToUnicodeStrS ( > + AuthConfigData->ReverseCHAPSecret, > + IfrNvData->Keyword[Index].ISCSIReverseChapSecret, > + ISCSI_CHAP_SECRET_STORAGE > + ); > + } > } > - } >=20 > - CopyMem(IfrNvData->ISCSIDisplayAttemptList, AttemptNameList, > ATTEMPT_NAME_LIST_SIZE); > + CopyMem(IfrNvData->ISCSIDisplayAttemptList, AttemptNameList, > ATTEMPT_NAME_LIST_SIZE); > + } > } >=20 > /** > Convert the IFR data to iSCSI configuration data. >=20 > @@ -1199,10 +1206,11 @@ > IScsiConvertlfrNvDataToAttemptConfigDataByKeyword ( > EFI_IP_ADDRESS Gateway; > EFI_INPUT_KEY Key; > UINT64 Lun; > EFI_STATUS Status; >=20 > + Attempt =3D NULL; > ZeroMem (IScsiName, sizeof (IScsiName)); >=20 > if (OffSet < ATTEMPT_BOOTENABLE_VAR_OFFSET) { > return EFI_SUCCESS; >=20 > @@ -1726,11 +1734,11 @@ > IScsiConvertlfrNvDataToAttemptConfigDataByKeyword ( >=20 >=20 > // > // Record the user configuration information in NVR. > // > - > + ASSERT (Attempt !=3D NULL); > UnicodeSPrint (mPrivate->PortString, (UINTN) ISCSI_NAME_IFR_MAX_SIZE, > L"Attempt %d", Attempt->AttemptConfigIndex); > return gRT->SetVariable ( > mPrivate->PortString, > &gEfiIScsiInitiatorNameProtocolGuid, > ISCSI_CONFIG_VAR_ATTR, > @@ -2705,10 +2713,11 @@ IScsiConfigProcessDefault ( > UINT8 *AttemptConfigOrder; > UINTN AttemptConfigOrderSize; > UINTN Index; > EFI_INPUT_KEY Key; >=20 > + AttemptConfigData =3D NULL; > // > // Is User creating a new attempt? > // > NewAttempt =3D FALSE; >=20 > @@ -2749,41 +2758,40 @@ IScsiConfigProcessDefault ( > L"InitialAttemptOrder", > &gIScsiConfigGuid, > &AttemptConfigOrderSize > ); >=20 > - if (AttemptConfigOrder !=3D NULL) { > - > - for (Index =3D 0; Index < AttemptConfigOrderSize / sizeof (UINT8);= Index++) > { > - UnicodeSPrint ( > - mPrivate->PortString, > - (UINTN) ISCSI_NAME_IFR_MAX_SIZE, > - L"Attempt %d", > - (UINTN) AttemptConfigOrder[Index] > - ); > - GetVariable2 ( > - mPrivate->PortString, > - &gEfiIScsiInitiatorNameProtocolGuid, > - (VOID**)&AttemptConfigData, > - NULL > - ); > - if (AttemptConfigData =3D=3D NULL || AttemptConfigData->Actived = =3D=3D > ISCSI_ACTIVE_ENABLED) { > - continue; > - } > - > - break; > - } > + ASSERT (AttemptConfigOrder !=3D NULL); >=20 > - if (Index > PcdGet8 (PcdMaxIScsiAttemptNumber)) { > - CreatePopUp ( > - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, > - &Key, > - L"Can not create more attempts, Please configure the > PcdMaxIScsiAttemptNumber if needed!", > - NULL > - ); > - return EFI_UNSUPPORTED; > + for (Index =3D 0; Index < AttemptConfigOrderSize / sizeof (UINT8); I= ndex++) > { > + UnicodeSPrint ( > + mPrivate->PortString, > + (UINTN) ISCSI_NAME_IFR_MAX_SIZE, > + L"Attempt %d", > + (UINTN) AttemptConfigOrder[Index] > + ); > + GetVariable2 ( > + mPrivate->PortString, > + &gEfiIScsiInitiatorNameProtocolGuid, > + (VOID**)&AttemptConfigData, > + NULL > + ); > + if (AttemptConfigData =3D=3D NULL || AttemptConfigData->Actived = =3D=3D > ISCSI_ACTIVE_ENABLED) { > + continue; > } > + > + break; > + } > + > + if (Index > PcdGet8 (PcdMaxIScsiAttemptNumber)) { > + CreatePopUp ( > + EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, > + &Key, > + L"Can not create more attempts, Please configure the > PcdMaxIScsiAttemptNumber if needed!", > + NULL > + ); > + return EFI_UNSUPPORTED; > } >=20 > if (AttemptConfigOrder !=3D NULL) { > FreePool (AttemptConfigOrder); > } > @@ -2796,10 +2804,11 @@ IScsiConfigProcessDefault ( > NicInfo->HwAddressSize, > NicInfo->VlanId, > MacString > ); >=20 > + ASSERT (AttemptConfigData !=3D NULL); > UnicodeStrToAsciiStrS (MacString, AttemptConfigData->MacString, size= of > (AttemptConfigData->MacString)); > AttemptConfigData->NicIndex =3D NicIndex; > AttemptConfigData->Actived =3D ISCSI_ACTIVE_ENABLED; >=20 > // > @@ -3126,10 +3135,11 @@ IScsiFormRouteConfig ( >=20 > Index =3D 0; > Index2 =3D 0; > NicInfo =3D NULL; > AttemptList =3D NULL; > + Status =3D EFI_SUCCESS; >=20 > if (This =3D=3D NULL || Configuration =3D=3D NULL || Progress =3D=3D N= ULL) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -3182,18 +3192,27 @@ IScsiFormRouteConfig ( > NULL > ); > goto Exit; > } > } else { > - Status =3D gIScsiInitiatorName.Get (&gIScsiInitiatorName, &BufferSiz= e, > InitiatorName); > + Status =3D IScsiGetValue (Configuration, L"&OFFSET=3D", &OffSet); > if (EFI_ERROR (Status)) { > - CreatePopUp ( > - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, > - &Key, > - L"Error: please configure iSCSI initiator name first!", > - NULL > - ); > + goto Exit; > + } > + > + if (OffSet >=3D ATTEMPT_MAC_ADDR_VAR_OFFSET) { > + Status =3D gIScsiInitiatorName.Get (&gIScsiInitiatorName, &BufferS= ize, > InitiatorName); > + if (EFI_ERROR (Status)) { > + CreatePopUp ( > + EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, > + &Key, > + L"Error: please configure iSCSI initiator name first!", > + NULL > + ); > + goto Exit; > + } > + } else { > goto Exit; > } >=20 > if (IfrNvData->ISCSIAddAttemptList[0] !=3D L'\0') { > Status =3DIScsiGetAttemptIndexList (IfrNvData->ISCSIAddAttemptList= , > IfrNvData->AddAttemptList, TRUE); > @@ -3288,25 +3307,19 @@ IScsiFormRouteConfig ( > Status =3D EFI_NOT_FOUND; > goto Exit; > } >=20 > } else { > - Status =3D IScsiGetValue (Configuration, L"&OFFSET=3D", &OffSet); > - if (EFI_ERROR (Status)) { > - goto Exit; > - } > Status =3D IScsiConvertlfrNvDataToAttemptConfigDataByKeyword > (IfrNvData, OffSet); > if (EFI_ERROR (Status)) { > goto Exit; > } > } > } >=20 > IScsiConfigUpdateAttempt (); >=20 > - Status =3D EFI_SUCCESS; > - > Exit: > if (InitiatorName !=3D NULL) { > FreePool (InitiatorName); > } >=20 > diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.h > b/NetworkPkg/IScsiDxe/IScsiConfig.h > index 21db3c3..7793d52 100644 > --- a/NetworkPkg/IScsiDxe/IScsiConfig.h > +++ b/NetworkPkg/IScsiDxe/IScsiConfig.h > @@ -29,11 +29,10 @@ extern ISCSI_FORM_CALLBACK_INFO > *mCallbackInfo; > ((UINT16) ((UINTN) &(((ISCSI_CONFIG_IFR_NVDATA *) 0)->Field))) >=20 > #define QUESTION_ID(Field) \ > ((UINT16) (VAR_OFFSET (Field) + CONFIG_OPTION_OFFSET)) >=20 > - > #define DYNAMIC_ONE_OF_VAR_OFFSET VAR_OFFSET (Enabled) > #define DYNAMIC_ORDERED_LIST_QUESTION_ID QUESTION_ID > (DynamicOrderedList) > #define DYNAMIC_ORDERED_LIST_VAR_OFFSET VAR_OFFSET > (DynamicOrderedList) > #define ATTEMPT_DEL_QUESTION_ID QUESTION_ID > (DeleteAttemptList) > #define ATTEMPT_DEL_VAR_OFFSET VAR_OFFSET > (DeleteAttemptList) > @@ -41,10 +40,11 @@ extern ISCSI_FORM_CALLBACK_INFO > *mCallbackInfo; > #define ATTEMPT_ADD_VAR_OFFSET VAR_OFFSET (AddAttemptList) >=20 > // > // Define QuestionId and OffSet for Keywords. > // > +#define ATTEMPT_MAC_ADDR_VAR_OFFSET VAR_OFFSET > (ISCSIMacAddr) > #define ATTEMPT_ATTEMPT_NAME_QUESTION_ID QUESTION_ID > (ISCSIAttemptName) > #define ATTEMPT_ATTEMPT_NAME_VAR_OFFSET VAR_OFFSET > (ISCSIAttemptName) > #define ATTEMPT_BOOTENABLE_QUESTION_ID QUESTION_ID > (ISCSIBootEnableList) > #define ATTEMPT_BOOTENABLE_VAR_OFFSET VAR_OFFSET > (ISCSIBootEnableList) > #define ATTEMPT_ADDRESS_TYPE_QUESTION_ID QUESTION_ID > (ISCSIIpAddressTypeList) > -- > 1.9.5.msysgit.1