From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 4CF5B21962301 for ; Wed, 12 Sep 2018 01:53:46 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2018 01:53:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,364,1531810800"; d="scan'208";a="90961139" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 12 Sep 2018 01:53:45 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 12 Sep 2018 01:53:44 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 12 Sep 2018 01:53:44 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by shsmsx102.ccr.corp.intel.com ([169.254.2.226]) with mapi id 14.03.0319.002; Wed, 12 Sep 2018 16:53:42 +0800 From: "Fu, Siyuan" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" Thread-Topic: [Patch v2] MdeModulePkg/Ip4Dxe: Sync the direct route entry setting. Thread-Index: AQHURCJR7CFJYM3tH0uDL7fYl4mW2KTsY+Tw Date: Wed, 12 Sep 2018 08:53:41 +0000 Message-ID: References: <20180904073829.23192-1-Jiaxin.wu@intel.com> In-Reply-To: <20180904073829.23192-1-Jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWFmNzkxZWUtNThhNy00ZDJmLWFlZWMtYWU5NGQ5ZjRhNDY2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiczBEbTZhdTN0TUo3Mnc5OEEyTktJUjV2SGtaZVQ1T0pjQm9cLzNReXVYYlhqc1RTbEpnck5yUWFiR2hqUTJcLzJkIn0= dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch v2] MdeModulePkg/Ip4Dxe: Sync the direct route entry setting. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2018 08:53:46 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan > -----Original Message----- > From: Wu, Jiaxin > Sent: Tuesday, September 4, 2018 3:38 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Wu, > Jiaxin > Subject: [Patch v2] MdeModulePkg/Ip4Dxe: Sync the direct route entry > setting. >=20 > v2: use "IP & Netmask" directly instead of defining an additional variabl= e. >=20 > This patch is to sync the direct route entry setting in both the default > and Instance route table {Subnet, Mask, NextHope} ( > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1143). >=20 > Cc: Ye Ting > Cc: Fu Siyuan > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Wu Jiaxin > Reviewed-by: Ye Ting > --- > MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 7 ------- > MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 10 +++++++--- > 2 files changed, 7 insertions(+), 10 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c > b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c > index c19a72730e..b52542cd84 100644 > --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c > +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c > @@ -557,17 +557,10 @@ Ip4Config2SetDefaultAddr ( > return Status; > } > } > } >=20 > - Ip4AddRoute ( > - IpSb->DefaultRouteTable, > - StationAddress, > - SubnetMask, > - IP4_ALLZERO_ADDRESS > - ); > - > // > // Add a route for the connected network. > // > Subnet =3D StationAddress & SubnetMask; >=20 > diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c > b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c > index 6a26143e30..13ebeab1be 100644 > --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c > +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c > @@ -670,14 +670,18 @@ Ip4ConfigProtocol ( >=20 > InsertTailList (&IpSb->Interfaces, &IpIf->Link); > } >=20 > // > - // Add a route to this connected network in the route table > + // Add a route to this connected network in the instance route table= . > // > - Ip4AddRoute (IpInstance->RouteTable, Ip, Netmask, > IP4_ALLZERO_ADDRESS); > - > + Ip4AddRoute ( > + IpInstance->RouteTable, > + Ip & Netmask, > + Netmask, > + IP4_ALLZERO_ADDRESS > + ); > } else { > // > // Use the default address. Check the state. > // > if (IpSb->State =3D=3D IP4_SERVICE_UNSTARTED) { > -- > 2.17.1.windows.2