From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0701.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe42::701]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DDAE41A1E30 for ; Mon, 15 Aug 2016 07:20:56 -0700 (PDT) Received: from AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM (10.162.138.25) by AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM (10.162.138.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Mon, 15 Aug 2016 14:20:53 +0000 Received: from AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM ([10.162.138.25]) by AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM ([10.162.138.25]) with mapi id 15.01.0549.027; Mon, 15 Aug 2016 14:20:53 +0000 From: "Cohen, Eugene" To: Jiaxin Wu , "edk2-devel@lists.01.org" CC: Ye Ting , Fu Siyuan Thread-Topic: [Patch] MdeModulePkg: Fix potential failure if UseDefaultAddress configured Thread-Index: AQHR9p9YFH+ayRGVvUypB5GxdFfeiaBKEoqQ Date: Mon, 15 Aug 2016 14:20:53 +0000 Message-ID: References: <1471229217-7004-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1471229217-7004-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=eugene@hp.com; x-originating-ip: [15.65.254.4] x-ms-office365-filtering-correlation-id: 652dd62d-5dd0-41ef-8660-08d3c5175de2 x-microsoft-exchange-diagnostics: 1; AT5PR84MB0291; 6:iOelKs74gEGOshjcahRUTwxQrTyaTcoJ9FI5Lr2r8yI4yzUvpZleXJ0o7h4ke5FUZrA2+TSTD+MMSjrnopI7nsu2RvQ0TiPFuy1Dsz9eXb6WmheiRbceQ/BzBmuaV1RH4WyMh+omXDYH9SrpBLuLp+1LobQ1E/RaslKM/G50dJruA3B1oGYNPbuF4v6ETb482jjKuYN+YRjvMb+kd4ToKef8VIWxQB3GlcXz3QuqaDV694dY3ybHL9hiG9Nra6pL087Cg6hdRL8BuCfsHKWbaSg1fUpty5vqVop66r9k0Wg=; 5:v6fb7C/QWxWspOGfeHHwtbcWXvD6rNjQkjgZeCh91KbnPSbSZpjGa5Ghdc5la3C8+2farm69vzudOZqJodOmq5EinPYqE4Rtxp0IUfjH5HQfmKvnWBY2jAqrxMTfpz5Rg4vXS7tZzth9VUkDHkHbGQ==; 24:a7FcEKbhgcPYB03VFTyfLRUWmCECSZXu7fN3kjJlyU/zRJy7R6TG7rjSjjhz34Rm+KupZPPtgO8R//6XbWCJk3rDpH1NYoS9/NmWnRRMtOU=; 7:inU04MDzYyG9nJhxDcGfvGpEpIT1NJBxUOz9W/74Wax5dUZkuGqkeGOKPIV8YjX9cEQM5yJhGJGNmAUW61FRgXvku7/jqsJjrfGPdo8A0XWB1Cf0s83SjGXWW7IFfGu+nX94eH/1+pCIoumIeYjAtSgxmv9O8BazjzzMcv2/lZFpSD5s8FMGVg/0UNPcxwqvP1voyv/k0tcy4HMmVji/eBEk8JrNYDwsdYKQB8olUvEuHw5OI5hLu+svSjQ5CmAm x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AT5PR84MB0291; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(162533806227266)(228905959029699)(73583498263828); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:AT5PR84MB0291; BCL:0; PCL:0; RULEID:; SRVR:AT5PR84MB0291; x-forefront-prvs: 0035B15214 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(377454003)(199003)(13464003)(6602003)(189002)(586003)(74316002)(122556002)(7846002)(77096005)(305945005)(10400500002)(2950100001)(7736002)(7696003)(2900100001)(5002640100001)(50986999)(33656002)(6116002)(5001770100001)(19580395003)(19580405001)(68736007)(2501003)(76176999)(105586002)(54356999)(8676002)(189998001)(102836003)(87936001)(3660700001)(92566002)(99286002)(8936002)(97736004)(9686002)(11100500001)(81166006)(81156014)(2906002)(3280700002)(86362001)(3846002)(106356001)(66066001)(106116001)(4326007)(101416001)(19627235001); DIR:OUT; SFP:1102; SCL:1; SRVR:AT5PR84MB0291; H:AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: hp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Aug 2016 14:20:53.6765 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: ca7981a2-785a-463d-b82a-3db87dfc3ce6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR84MB0291 Subject: Re: [Patch] MdeModulePkg: Fix potential failure if UseDefaultAddress configured 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: Mon, 15 Aug 2016 14:20:57 -0000 Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Tested-by: Eugene Cohen with the provision that Configure() retries are maintained for TCP cases > -----Original Message----- > From: Jiaxin Wu [mailto:jiaxin.wu@intel.com] > Sent: Sunday, August 14, 2016 8:47 PM > To: edk2-devel@lists.01.org > Cc: Cohen, Eugene ; Ye Ting ; > Fu Siyuan > Subject: [Patch] MdeModulePkg: Fix potential failure if > UseDefaultAddress configured >=20 > IpSb->Reconfig should not be set to TRUE to focal the reconfiguration > during the policy changes from Static to DHCP. It's redundancy because > the default router table and default addresses have been freed ahead > ( > Detailed see Ip4Config2OnPolicyChanged() function). Otherwise, the > potential failure will appear if UseDefaultAddress configured. > Reproduce > steps see below: >=20 > #1. Set policy to DHCP. > #2. If DHCP process is not complete yet, then run one APP to invoke > UDP4 > Configure with "UseDefaultAddress =3D TRUE" (loop to call UDP4 > Configure > until Ip4Mode.IsConfigured changes to TRUE). > #3. Even DHCP succeed but Ip4Mode.IsConfigured flag never set to > TRUE >=20 > Concrete analysis is as follows: > In #1, the policy will be set to DHCP, and then > Ip4Config2OnPolicyChanged() > will be called. In this function, if "IpSb->Reconfig" flag is set to TRUE= , > the original "IpSb->DefaultInterface" will be abandoned/freed once > the > DHCP process finished. >=20 > In #2, UDP4 Configure with "UseDefaultAddress =3D TRUE" is called, that > means > the default interface (IpSb->DefaultInterface) will be selected as > current > instance's interface. >=20 > In #3, when DHCP process finished, the original DefaultInterface will be > abandoned/freed because "IpSb->Reconfig" flag is true. Meanwhile, > one new > interface is assigned to "IpSb->DefaultInterface". This new interface is > different to the original one assigned to the UDP4 Configured instance. > So, > even DHCP process succeed, the up caller will never have the chance > to get > it's truly status. >=20 > Cc: Cohen Eugene > Cc: Ye Ting > Cc: Fu Siyuan > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jiaxin Wu > --- > MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 1 - > 1 file changed, 1 deletion(-) >=20 > diff --git > a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c > b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c > index f91a935..75ad301 100644 > --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c > +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c > @@ -148,11 +148,10 @@ Ip4Config2OnPolicyChanged ( >=20 > // > // Start the dhcp configuration. > // > if (NewPolicy =3D=3D Ip4Config2PolicyDhcp) { > - IpSb->Reconfig =3D TRUE; > Ip4StartAutoConfig (&IpSb->Ip4Config2Instance); > } >=20 > } >=20 > -- > 1.9.5.msysgit.1