Re: [edk2] [Patch v2] MdeModulePkg/Ip4Dxe: Sync the direct route entry setting.

2018-09-12 Thread Fu, Siyuan
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.
> 
> 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 (>Interfaces, >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

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


[edk2] [Patch v2] MdeModulePkg/Ip4Dxe: Sync the direct route entry setting.

2018-09-04 Thread Jiaxin Wu
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 (>Interfaces, >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

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