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=134.134.136.31; helo=mga06.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 F1DD821109FE0 for ; Thu, 30 Aug 2018 18:49:45 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Aug 2018 18:49:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,309,1531810800"; d="scan'208";a="69235772" Received: from jiaxinwu-mobl.ccr.corp.intel.com ([10.239.192.161]) by orsmga007.jf.intel.com with ESMTP; 30 Aug 2018 18:49:35 -0700 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan , Wu Jiaxin Date: Fri, 31 Aug 2018 09:49:31 +0800 Message-Id: <20180831014931.7020-1-Jiaxin.wu@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 Subject: [Patch] 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: Fri, 31 Aug 2018 01:49:46 -0000 This patch is to sync the direct route entry setting in both the default and Instance route table {Subnet, Mask, NextHope}. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin --- .../Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 7 ------- MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 13 ++++++++++--- 2 files changed, 10 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..c68dad7a3c 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c @@ -593,10 +593,11 @@ Ip4ConfigProtocol ( IP4_SERVICE *IpSb; IP4_INTERFACE *IpIf; EFI_STATUS Status; IP4_ADDR Ip; IP4_ADDR Netmask; + IP4_ADDR Subnet; EFI_ARP_PROTOCOL *Arp; EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2; EFI_IP4_CONFIG2_POLICY Policy; IpSb = IpInstance->Service; @@ -670,14 +671,20 @@ 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); - + Subnet = Ip & Netmask; + + Ip4AddRoute ( + IpInstance->RouteTable, + Subnet, + Netmask, + IP4_ALLZERO_ADDRESS + ); } else { // // Use the default address. Check the state. // if (IpSb->State == IP4_SERVICE_UNSTARTED) { -- 2.17.1.windows.2