public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] MdeModulePkg/Ip4Dxe: Sync the direct route entry setting.
@ 2018-08-31  1:49 Jiaxin Wu
  2018-08-31  8:56 ` Ye, Ting
  0 siblings, 1 reply; 2+ messages in thread
From: Jiaxin Wu @ 2018-08-31  1:49 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

This patch is to sync the direct route entry setting in both the default
and Instance route table {Subnet, Mask, NextHope}.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 .../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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] MdeModulePkg/Ip4Dxe: Sync the direct route entry setting.
  2018-08-31  1:49 [Patch] MdeModulePkg/Ip4Dxe: Sync the direct route entry setting Jiaxin Wu
@ 2018-08-31  8:56 ` Ye, Ting
  0 siblings, 0 replies; 2+ messages in thread
From: Ye, Ting @ 2018-08-31  8:56 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Fu, Siyuan, Wu, Jiaxin

Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiaxin Wu
Sent: Friday, August 31, 2018 9:50 AM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [Patch] MdeModulePkg/Ip4Dxe: Sync the direct route entry setting.

This patch is to sync the direct route entry setting in both the default and Instance route table {Subnet, Mask, NextHope}.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 .../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

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-31  8:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-31  1:49 [Patch] MdeModulePkg/Ip4Dxe: Sync the direct route entry setting Jiaxin Wu
2018-08-31  8:56 ` Ye, Ting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox