From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 A1A832195406F for ; Fri, 28 Apr 2017 01:27:05 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2017 01:27:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,387,1488873600"; d="scan'208";a="79970675" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 28 Apr 2017 01:27:02 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Apr 2017 01:26:52 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Apr 2017 01:26:52 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.224]) with mapi id 14.03.0319.002; Fri, 28 Apr 2017 16:25:39 +0800 From: "Wu, Jiaxin" To: "Zhang, Lubo" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" Thread-Topic: [patch] NetworkPkg: Fix bug in iSCSI mode ipv6 when enabling target DHCP. Thread-Index: AQHSv+pbvdXgmE3ZWkeOVHDAII1QtqHacimg Date: Fri, 28 Apr 2017 08:25:39 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B7274162C5179@SHSMSX103.ccr.corp.intel.com> References: <1493361622-7604-1-git-send-email-lubo.zhang@intel.com> In-Reply-To: <1493361622-7604-1-git-send-email-lubo.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTU2YjBlZWYtMWViMC00MmYyLWFhYTEtYTMxNzA4YmJjZGFmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InNDeFZpcjZQSTNaXC9aUjY0b0F0d2k5aTl3RDBTeGZGYnNqVUhcLzQ1WlVXTT0ifQ== 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: Fix bug in iSCSI mode ipv6 when enabling target DHCP. 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: Fri, 28 Apr 2017 08:27:05 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Wu Jiaxin Thanks, Jiaxin > -----Original Message----- > From: Zhang, Lubo > Sent: Friday, April 28, 2017 2:40 PM > To: edk2-devel@lists.01.org > Cc: Wu, Jiaxin ; Ye, Ting ; Fu, S= iyuan > > Subject: [patch] NetworkPkg: Fix bug in iSCSI mode ipv6 when enabling tar= get > DHCP. >=20 > if the server name expressed as a site local address begain with FEC0 > when retrieving from dhcpv6 option 59 boot file url, it incorrectly proce= ss it > as a dns name. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Zhang Lubo > Cc: Wu Jiaxin > Cc: Ye Ting > Cc: Fu Siyuan > --- > NetworkPkg/IScsiDxe/IScsiDhcp6.c | 38 +++++++++++++++++++++++++---------= -- > -- > 1 file changed, 25 insertions(+), 13 deletions(-) >=20 > diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp6.c > b/NetworkPkg/IScsiDxe/IScsiDhcp6.c > index d3535d5..06c634c 100644 > --- a/NetworkPkg/IScsiDxe/IScsiDhcp6.c > +++ b/NetworkPkg/IScsiDxe/IScsiDhcp6.c > @@ -48,11 +48,11 @@ IScsiDhcp6ExtractRootPath ( > ISCSI_SESSION_CONFIG_NVDATA *ConfigNvData; > EFI_IP_ADDRESS Ip; > UINT8 IpMode; >=20 > ConfigNvData =3D &ConfigData->SessionConfigData; > - > + ConfigNvData->DnsMode =3D FALSE; > // > // "iscsi:"":"":"":"":" > // > IScsiRootPathIdLen =3D (UINT16) AsciiStrLen (ISCSI_ROOT_PATH_ID); >=20 > @@ -80,27 +80,40 @@ IScsiDhcp6ExtractRootPath ( >=20 > // > // Extract SERVERNAME field in the Root Path option. > // > if (TmpStr[Index] !=3D ISCSI_ROOT_PATH_ADDR_START_DELIMITER) { > - Status =3D EFI_INVALID_PARAMETER; > - goto ON_EXIT; > + // > + // The servername is expressed as domain name. > + // > + ConfigNvData->DnsMode =3D TRUE; > } else { > Index++; > } >=20 > Fields[RP_FIELD_IDX_SERVERNAME].Str =3D &TmpStr[Index]; >=20 > - while ((TmpStr[Index] !=3D ISCSI_ROOT_PATH_ADDR_END_DELIMITER) && > (Index < Length)) { > - Index++; > - } > + if (!ConfigNvData->DnsMode) { > + while ((TmpStr[Index] !=3D ISCSI_ROOT_PATH_ADDR_END_DELIMITER)&& > (Index < Length)) { > + Index++; > + } >=20 > - // > - // Skip ']' and ':'. > - // > - TmpStr[Index] =3D '\0'; > - Index +=3D 2; > + // > + // Skip ']' and ':'. > + // > + TmpStr[Index] =3D '\0'; > + Index +=3D 2; > + } else { > + while ((TmpStr[Index] !=3D ISCSI_ROOT_PATH_FIELD_DELIMITER) && (Inde= x < > Length)) { > + Index++; > + } > + // > + // Skip ':'. > + // > + TmpStr[Index] =3D '\0'; > + Index +=3D 1; > + } >=20 > Fields[RP_FIELD_IDX_SERVERNAME].Len =3D (UINT8) AsciiStrLen > (Fields[RP_FIELD_IDX_SERVERNAME].Str); >=20 > // > // Extract others fields in the Root Path option string. > @@ -151,12 +164,11 @@ IScsiDhcp6ExtractRootPath ( > } >=20 > // > // Server name is expressed as domain name, just save it. > // > - if ((!NET_IS_DIGIT (*(Field->Str))) && (*(Field->Str) !=3D '[')) { > - ConfigNvData->DnsMode =3D TRUE; > + if (ConfigNvData->DnsMode) { > if (Field->Len > sizeof (ConfigNvData->TargetUrl)) { > return EFI_INVALID_PARAMETER; > } > CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len); > ConfigNvData->TargetUrl[Field->Len + 1] =3D '\0'; > -- > 1.9.5.msysgit.1