From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: Two or more type TXT spf records found.) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 BD734210F93DA for ; Tue, 4 Sep 2018 00:38:34 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 00:38:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,328,1531810800"; d="scan'208";a="86956344" Received: from jiaxinwu-mobl.ccr.corp.intel.com ([10.239.192.161]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2018 00:38:32 -0700 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan , Wu Jiaxin Date: Tue, 4 Sep 2018 15:38:29 +0800 Message-Id: <20180904073829.23192-1-Jiaxin.wu@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 Subject: [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: Tue, 04 Sep 2018 07:38:35 -0000 v2: use "IP & Netmask" directly instead of defining an additional variable. 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=1143). 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(-) 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; } } } - Ip4AddRoute ( - IpSb->DefaultRouteTable, - StationAddress, - SubnetMask, - IP4_ALLZERO_ADDRESS - ); - // // Add a route for the connected network. // Subnet = StationAddress & SubnetMask; 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 ( InsertTailList (&IpSb->Interfaces, &IpIf->Link); } // - // 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 == IP4_SERVICE_UNSTARTED) { -- 2.17.1.windows.2