public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] NetworkPkg:Generate the correct operational state of the interface.
@ 2017-02-10  3:17 Zhang Lubo
  2017-02-10  3:32 ` Wu, Jiaxin
  0 siblings, 1 reply; 4+ messages in thread
From: Zhang Lubo @ 2017-02-10  3:17 UTC (permalink / raw)
  To: edk2-devel; +Cc: Santhapur Naveen, Ye Ting, Fu Siyuan, Wu Jiaxin

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



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

end of thread, other threads:[~2017-02-10  5:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-10  3:17 [patch] NetworkPkg:Generate the correct operational state of the interface Zhang Lubo
2017-02-10  3:32 ` Wu, Jiaxin
2017-02-10  3:38   ` Zhang, Lubo
2017-02-10  5:42     ` Ye, Ting

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