[edk2] [patch] NetworkPkg:Generate the correct operational state of the interface.

Zhang Lubo posted 1 patch 7 years, 8 months ago
Failed in applying to current master (apply log)
NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
[edk2] [patch] NetworkPkg:Generate the correct operational state of the interface.
Posted by Zhang Lubo 7 years, 8 months ago
Currently, When there are more than 9 Ethernet ports available,
'ifconfig -l' is not listing all the ports, only show the ports 0 to 9.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Santhapur Naveen <naveens@amiindia.co.in>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
---
 NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
index 4e881fd..e309b69 100644
--- a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
+++ b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
@@ -1436,15 +1436,16 @@ VOID
 Ip6ConfigInitIfInfo (
   IN  IP6_SERVICE                    *IpSb,
   OUT EFI_IP6_CONFIG_INTERFACE_INFO  *IfInfo
   )
 {
-  IfInfo->Name[0] = L'e';
-  IfInfo->Name[1] = L't';
-  IfInfo->Name[2] = L'h';
-  IfInfo->Name[3] = (CHAR16) (L'0' + IpSb->Ip6ConfigInstance.IfIndex);
-  IfInfo->Name[4] = 0;
+  UnicodeSPrint (
+    IfInfo->Name,
+    sizeof (IfInfo->Name),
+    L"eth%x",
+    IpSb->Ip6ConfigInstance.IfIndex
+  );
 
   IfInfo->IfType        = IpSb->SnpMode.IfType;
   IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;
   CopyMem (&IfInfo->HwAddress, &IpSb->SnpMode.CurrentAddress, IfInfo->HwAddressSize);
 }
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [patch] NetworkPkg:Generate the correct operational state of the interface.
Posted by Wu, Jiaxin 7 years, 8 months ago
Need change the commit log, replace the 'ifconfig -l' with 'ifconfig6 -l' since it's the fix for IPv6.

Others is good to me.

Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

Thanks,
Jiaxin


> -----Original Message-----
> From: Zhang, Lubo
> Sent: Friday, February 10, 2017 11:18 AM
> To: edk2-devel@lists.01.org
> Cc: Santhapur Naveen <naveens@amiindia.co.in>; Ye, Ting
> <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin
> <jiaxin.wu@intel.com>
> Subject: [patch] NetworkPkg:Generate the correct operational state of the
> interface.
> 
> Currently, When there are more than 9 Ethernet ports available,
> 'ifconfig -l' is not listing all the ports, only show the ports 0 to 9.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
> Cc: Santhapur Naveen <naveens@amiindia.co.in>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> ---
>  NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> index 4e881fd..e309b69 100644
> --- a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> +++ b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> @@ -1436,15 +1436,16 @@ VOID
>  Ip6ConfigInitIfInfo (
>    IN  IP6_SERVICE                    *IpSb,
>    OUT EFI_IP6_CONFIG_INTERFACE_INFO  *IfInfo
>    )
>  {
> -  IfInfo->Name[0] = L'e';
> -  IfInfo->Name[1] = L't';
> -  IfInfo->Name[2] = L'h';
> -  IfInfo->Name[3] = (CHAR16) (L'0' + IpSb->Ip6ConfigInstance.IfIndex);
> -  IfInfo->Name[4] = 0;
> +  UnicodeSPrint (
> +    IfInfo->Name,
> +    sizeof (IfInfo->Name),
> +    L"eth%x",
> +    IpSb->Ip6ConfigInstance.IfIndex
> +  );
> 
>    IfInfo->IfType        = IpSb->SnpMode.IfType;
>    IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;
>    CopyMem (&IfInfo->HwAddress, &IpSb->SnpMode.CurrentAddress,
> IfInfo->HwAddressSize);
>  }
> --
> 1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [patch] NetworkPkg:Generate the correct operational state of the interface.
Posted by Zhang, Lubo 7 years, 8 months ago
Yes,  I just find the typo error.

Thanks
Lubo

-----Original Message-----
From: Wu, Jiaxin 
Sent: Friday, February 10, 2017 11:33 AM
To: Zhang, Lubo <lubo.zhang@intel.com>; edk2-devel@lists.01.org
Cc: Santhapur Naveen <naveens@amiindia.co.in>; Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>
Subject: RE: [patch] NetworkPkg:Generate the correct operational state of the interface.

Need change the commit log, replace the 'ifconfig -l' with 'ifconfig6 -l' since it's the fix for IPv6.

Others is good to me.

Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

Thanks,
Jiaxin


> -----Original Message-----
> From: Zhang, Lubo
> Sent: Friday, February 10, 2017 11:18 AM
> To: edk2-devel@lists.01.org
> Cc: Santhapur Naveen <naveens@amiindia.co.in>; Ye, Ting 
> <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin 
> <jiaxin.wu@intel.com>
> Subject: [patch] NetworkPkg:Generate the correct operational state of 
> the interface.
> 
> Currently, When there are more than 9 Ethernet ports available, 
> 'ifconfig -l' is not listing all the ports, only show the ports 0 to 9.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
> Cc: Santhapur Naveen <naveens@amiindia.co.in>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> ---
>  NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> index 4e881fd..e309b69 100644
> --- a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> +++ b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> @@ -1436,15 +1436,16 @@ VOID
>  Ip6ConfigInitIfInfo (
>    IN  IP6_SERVICE                    *IpSb,
>    OUT EFI_IP6_CONFIG_INTERFACE_INFO  *IfInfo
>    )
>  {
> -  IfInfo->Name[0] = L'e';
> -  IfInfo->Name[1] = L't';
> -  IfInfo->Name[2] = L'h';
> -  IfInfo->Name[3] = (CHAR16) (L'0' + 
> IpSb->Ip6ConfigInstance.IfIndex);
> -  IfInfo->Name[4] = 0;
> +  UnicodeSPrint (
> +    IfInfo->Name,
> +    sizeof (IfInfo->Name),
> +    L"eth%x",
> +    IpSb->Ip6ConfigInstance.IfIndex
> +  );
> 
>    IfInfo->IfType        = IpSb->SnpMode.IfType;
>    IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;
>    CopyMem (&IfInfo->HwAddress, &IpSb->SnpMode.CurrentAddress,
> IfInfo->HwAddressSize);
>  }
> --
> 1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [patch] NetworkPkg:Generate the correct operational state of the interface.
Posted by Ye, Ting 7 years, 8 months ago
Reviewed-by: Ye Ting <ting.ye@intel.com>


-----Original Message-----
From: Zhang, Lubo 
Sent: Friday, February 10, 2017 11:38 AM
To: Wu, Jiaxin <jiaxin.wu@intel.com>; edk2-devel@lists.01.org
Cc: Santhapur Naveen <naveens@amiindia.co.in>; Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>
Subject: RE: [patch] NetworkPkg:Generate the correct operational state of the interface.

Yes,  I just find the typo error.

Thanks
Lubo

-----Original Message-----
From: Wu, Jiaxin
Sent: Friday, February 10, 2017 11:33 AM
To: Zhang, Lubo <lubo.zhang@intel.com>; edk2-devel@lists.01.org
Cc: Santhapur Naveen <naveens@amiindia.co.in>; Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>
Subject: RE: [patch] NetworkPkg:Generate the correct operational state of the interface.

Need change the commit log, replace the 'ifconfig -l' with 'ifconfig6 -l' since it's the fix for IPv6.

Others is good to me.

Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

Thanks,
Jiaxin


> -----Original Message-----
> From: Zhang, Lubo
> Sent: Friday, February 10, 2017 11:18 AM
> To: edk2-devel@lists.01.org
> Cc: Santhapur Naveen <naveens@amiindia.co.in>; Ye, Ting 
> <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin 
> <jiaxin.wu@intel.com>
> Subject: [patch] NetworkPkg:Generate the correct operational state of 
> the interface.
> 
> Currently, When there are more than 9 Ethernet ports available, 
> 'ifconfig -l' is not listing all the ports, only show the ports 0 to 9.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
> Cc: Santhapur Naveen <naveens@amiindia.co.in>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> ---
>  NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> index 4e881fd..e309b69 100644
> --- a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> +++ b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
> @@ -1436,15 +1436,16 @@ VOID
>  Ip6ConfigInitIfInfo (
>    IN  IP6_SERVICE                    *IpSb,
>    OUT EFI_IP6_CONFIG_INTERFACE_INFO  *IfInfo
>    )
>  {
> -  IfInfo->Name[0] = L'e';
> -  IfInfo->Name[1] = L't';
> -  IfInfo->Name[2] = L'h';
> -  IfInfo->Name[3] = (CHAR16) (L'0' +
> IpSb->Ip6ConfigInstance.IfIndex);
> -  IfInfo->Name[4] = 0;
> +  UnicodeSPrint (
> +    IfInfo->Name,
> +    sizeof (IfInfo->Name),
> +    L"eth%x",
> +    IpSb->Ip6ConfigInstance.IfIndex
> +  );
> 
>    IfInfo->IfType        = IpSb->SnpMode.IfType;
>    IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;
>    CopyMem (&IfInfo->HwAddress, &IpSb->SnpMode.CurrentAddress,
> IfInfo->HwAddressSize);
>  }
> --
> 1.9.5.msysgit.1

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