From nobody Wed Dec 25 14:19:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1507264695718412.35322339093716; Thu, 5 Oct 2017 21:38:15 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D0B9F21EA15C9; Thu, 5 Oct 2017 21:34:50 -0700 (PDT) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0075.outbound.protection.outlook.com [104.47.42.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E520C21EA15C4 for ; Thu, 5 Oct 2017 21:34:49 -0700 (PDT) Received: from BN6PR03CA0051.namprd03.prod.outlook.com (10.173.137.13) by BN6PR03MB2689.namprd03.prod.outlook.com (10.173.144.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 6 Oct 2017 04:38:11 +0000 Received: from BN1AFFO11FD023.protection.gbl (2a01:111:f400:7c10::182) by BN6PR03CA0051.outlook.office365.com (2603:10b6:404:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Fri, 6 Oct 2017 04:38:10 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD023.mail.protection.outlook.com (10.58.52.83) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Fri, 6 Oct 2017 04:38:10 +0000 Received: from uefi-workstation.ap.freescale.net (uefi-workstation.ap.freescale.net [10.232.14.83]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v964c7ZU030418; Thu, 5 Oct 2017 21:38:07 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.42.75; helo=nam03-by2-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; From: Meenakshi Aggarwal To: , , , Date: Fri, 6 Oct 2017 10:10:09 +0530 Message-ID: <1507264809-19123-1-git-send-email-meenakshi.aggarwal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507185391-6076-1-git-send-email-meenakshi.aggarwal@nxp.com> References: <1507185391-6076-1-git-send-email-meenakshi.aggarwal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131517382908406356; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7966004)(336005)(376002)(39860400002)(39380400002)(346002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(5660300001)(189998001)(50226002)(8676002)(106466001)(2201001)(104016004)(5003940100001)(8936002)(48376002)(50466002)(4326008)(47776003)(2906002)(33646002)(305945005)(86362001)(81166006)(356003)(76176999)(69596002)(8656003)(53936002)(36756003)(81156014)(110136005)(16586007)(77096006)(2950100002)(50986999)(498600001)(97736004)(68736007)(316002)(85426001)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2689; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD023; 1:W3HfRKQviwkSXD8dX8k52kaK4Nqn5BudECCI6v6GICYIB4e3VY7QhWpFmu7IZNqxHioPPH+fqUipiyAuJ3tARHDymm1TRYzdcUPPD0pkJjKplcWbnhyJHP9rOC3NsUzT MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd421216-d340-4b8f-08f3-08d50c740c80 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:BN6PR03MB2689; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2689; 3:FLDWNTzkk8SoY2hmkictWRzutGNRZTLXGRzJ/xLrhMR+4GeIF+EoTHjyBx18Vd9wuhNoL799IfoRF49UWccnfkCH5qeXW06lRQdK0+BoZyfG5fzS2g4Shal769SEICfh0TNAOQUivaU5DXgfnY2l0Irr9q7hgXO01QgCJ2HRk3Jc61gOUxsJS5efUnKwT6bE0kDFDob4NiOA6Jxx0cegDAId9B2myZLiVTy3E8VCI69lnVZRYiz3W37iMFpKR/RDhhne9xXHsMeSVLREy7QIg9DuD1YJNJQV7B0hiyxVZrh6xBv6j6FRqk6ifvbL7QeN8deciOJWA5+GIQgVfrw82A==; 25:sKzuGJV6BoBKxt0+f43W1++ZTlpsKJ3RdNj1AtgGD2shXbJPXhTHP6qMyo0M8xFeQ3lM7hyfgxIYpVe8mGmG7x69xbDEaerqK7x4jGT92If2q3MGct//LXC6Ndz6PzFdtbIoLa2MkM66zgI6a2/62DX1GpBg/zJU7R8UtNyDirSksP/98dlKJiR67MzHiiQ+QCWzCU1nU/YF6nmZzSVDxrTF8EX9syttyN45RKNyL9sDHKipJw7/Tu2VANE96sRcRJ8nRcKc20niK7EwX/DWoRbXIpBqllQ6yjpmTVIj+PJ4gV9jp3QWvfxFhJ90ukm4SdGo6t/ewf3RFtag+MSV7w==; 31:M6sHrmqufuNEAGlevWupys+FJEiptyB5Kr3oqIVXpexuXJx90Ff+UUDv/54kOEiy95+gvGIdXgig1zIy3fZbvYVzyltDASIFo2hIC3YvtfGXLHUk+otyW0vljucNVjgSqftj+/Bw7Y7OaMM/KVHjVpUf+9cm7xkSC8CPIdSMjuceYogKxX0DCAX+1QcsRrxm4sahqI9bEYGQ8tQslthIdFCja2Xg39B3/sjXOUt5jaw= X-MS-TrafficTypeDiagnostic: BN6PR03MB2689: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123561025)(20161123565025)(20161123563025)(20161123559100)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB2689; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB2689; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2689; 4:z3L7YApGHrG7mc04+RjK/AhvIkSBrgXPaCnAUItm2U3S/kOTkDHkbFNSGBDzwsnJ/mfOuTgkpUhaydx1ZEu0oHx7M3cqwwBhCeJjY/zF5YmHo/8HwnuHjM6YXurWPdQ687fO5Fs0d+XekCScuJCl6h5U9sPQ17w1tAo8K9QWBejtp/mxkcSiA2SKltvtcBUoZYspCNZIUe+Wg+DuwiMy4oHjd7SLmn2d9THQtSMy8gkgKjFlEwAcY0lFUWZE26JMbDJzfFcToHwGsDjSETtcJcpAsLTZomgOv62FmCVi/VA= X-Forefront-PRVS: 0452022BE1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2689; 23:3O/x26hTzxyWKp2YMiyqsC/0O3rw2tLC+wCrZ8qLn?= =?us-ascii?Q?z2i6kPS5SYUlHFfS3avDFsA+8A17C9BNYIVXZZTwQVMoju9bIlKIRjPXz8b8?= =?us-ascii?Q?+FOB+bzb6EM05PWeunSW6hPnH0ZADGnono+v2bD55Qy6lc7a+5w6VERij3XG?= =?us-ascii?Q?6144q+MJ1pj7+kpCZs6F+dAQqTSp+n9dHXL6BU2kJGPi7ZD3kFJuPAP1GMLz?= =?us-ascii?Q?ZQbaD9V+TAFdL0sshnOHHDVRDbHTJ28Vzll+XDq7nlE/JlT+f0NyYM9zj5RL?= =?us-ascii?Q?xBULp/MX+GY9si+6GvqQoJXsop3SLB3JYG6KKU7CBhs87/yd4CoPgQNkQ8mI?= =?us-ascii?Q?sYzu1Mu84OD9ghrpJyyzyClgo9PE5flTrgQg70XNwVLncWuxjF/gMjRXPrtD?= =?us-ascii?Q?WibkEYrJogHadc47eYIdAsToY5gVKiVa2VKlqSs+bCNn8bWwi0yUpmrlExkZ?= =?us-ascii?Q?tuOs0RChPT6nNwkuuNsFdiZIew7TWzkRBY69nByB5omdHK1Y3fH2C4Ozqxhf?= =?us-ascii?Q?obcKNGHL2et11kTDnM8X8SOfrNnrVEmmD5/lfk6P/W4QHB1OqnQEkVzGZ6Gk?= =?us-ascii?Q?nrhuqxr2iR98eNCnhq5c+iymbuy3E7/KACkK7GGPx1h/VHMdYcJ2PCEzHmN3?= =?us-ascii?Q?m25w03i8SDx59qfkPog8nc8JtjhYDEx9XOHz7P15Ozp234rQbL5M8pf3joji?= =?us-ascii?Q?NGlQNdhL3KHyYRatufwSanoeTABIOmtGgkb7KqeIvx9HNIw64tE8iLP3PD0s?= =?us-ascii?Q?9ZJlkqxLyV2uDF6O0mveX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PHDNrqgS9rAAvP4Ifdqjg5+XMuS4Hl1EBgRs1A6eS/cpzutNCr+HxYBP7o=; 7:15YHThRz7+JGeWBsQ9e20hUDns+1VGXEiLV6rZc0JA0DQg4RI/MBWWUz3gyGNfJru9CErd9MmV6V2wyM6zzcu29Ds3xL3wMz9dhzfPiiL1SdHJjxpSUvaHUPG6zlyagm79bszUoXBuzzPQRNy4P0QPl04Q94R3gjwrDdFcxgS00uHUJH+Bs9IqX3KIDCHytvlcZCzH33gBxD7dGIk9dGnGiUHCgHnOeYvN3cxbhbP60= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2017 04:38:10.6066 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2689 Subject: [edk2] [PATCH v2] Ifconfig : Fixed False information about Media State. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Issue : We were setting MediaPresent as TRUE (default), so even if NetLibDetectMedia() did not set MediaPresent Flag as TRUE, ifconfig always display Media State as 'Media Present' Fix : Set MediaPresent as FALSE before calling NetLibDetectMedia() Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Meenakshi Aggarwal --- ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c b/She= llPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c index 4db07b2..90ca724 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c @@ -576,11 +576,14 @@ IfConfigShowInterfaceInfo ( // // Get Media State. // - NetLibDetectMedia (IfCb->NicHandle, &MediaPresent); - if (!MediaPresent) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_MEDIA= _STATE), gShellNetwork1HiiHandle, L"Media disconnected"); + if (EFI_SUCCESS =3D=3D NetLibDetectMedia (IfCb->NicHandle, &MediaPrese= nt)) { + if (!MediaPresent) { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_MED= IA_STATE), gShellNetwork1HiiHandle, L"Media disconnected"); + } else { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_MED= IA_STATE), gShellNetwork1HiiHandle, L"Media present"); + } } else { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_MEDIA= _STATE), gShellNetwork1HiiHandle, L"Media present"); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_MEDIA= _STATE), gShellNetwork1HiiHandle, L"Media disconnected"); } =20 // --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel