public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Zhang Lubo <lubo.zhang@intel.com>
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.
Date: Fri, 10 Feb 2017 11:17:54 +0800	[thread overview]
Message-ID: <1486696674-41256-1-git-send-email-lubo.zhang@intel.com> (raw)

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



             reply	other threads:[~2017-02-10  3:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10  3:17 Zhang Lubo [this message]
2017-02-10  3:32 ` [patch] NetworkPkg:Generate the correct operational state of the interface Wu, Jiaxin
2017-02-10  3:38   ` Zhang, Lubo
2017-02-10  5:42     ` Ye, Ting

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486696674-41256-1-git-send-email-lubo.zhang@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox