From nobody Wed Dec 25 14:19:14 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 1507265183302628.7779978942876; Thu, 5 Oct 2017 21:46:23 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0481521EA15CF; Thu, 5 Oct 2017 21:42:59 -0700 (PDT) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0070.outbound.protection.outlook.com [104.47.32.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2BB5F21EA15C4 for ; Thu, 5 Oct 2017 21:42:57 -0700 (PDT) Received: from BN6PR03CA0089.namprd03.prod.outlook.com (10.164.122.155) by BN6PR03MB2691.namprd03.prod.outlook.com (10.173.144.10) 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:46:19 +0000 Received: from BL2FFO11FD037.protection.gbl (2a01:111:f400:7c09::134) by BN6PR03CA0089.outlook.office365.com (2603:10b6:405:6f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.11 via Frontend Transport; Fri, 6 Oct 2017 04:46:19 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD037.mail.protection.outlook.com (10.173.161.133) 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:46:18 +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 v964jxTL001243; Thu, 5 Oct 2017 21:46:16 -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.32.70; helo=nam01-sn1-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:18:14 +0530 Message-ID: <1507265294-19227-2-git-send-email-meenakshi.aggarwal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507265294-19227-1-git-send-email-meenakshi.aggarwal@nxp.com> References: <1507264809-19123-1-git-send-email-meenakshi.aggarwal@nxp.com> <1507265294-19227-1-git-send-email-meenakshi.aggarwal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131517387790549483; (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)(346002)(376002)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(69596002)(77096006)(110136005)(8936002)(106466001)(5003940100001)(68736007)(86362001)(105606002)(5660300001)(2906002)(16586007)(4326008)(48376002)(356003)(104016004)(305945005)(50466002)(8676002)(8656003)(50226002)(53936002)(2201001)(81166006)(2950100002)(85426001)(189998001)(498600001)(97736004)(76176999)(316002)(47776003)(50986999)(36756003)(81156014)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2691; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD037; 1:cWgcUAQYKd7ZogUdEcviQHJikpmKY7R1/GW6bDzotxJ96oTysNTHBZ2C2ESNrhg6hljF+C/vlrxhb7JAbLabUuJth6wMmuQty54O35DwjCj02WGAkwCSwk0+bQEu32ef MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 49712dc1-d686-4438-a08a-08d50c752f7f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:BN6PR03MB2691; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2691; 3:Svd1qEroGFjrnweYaG6psas86NbfGkKayWiTrBAleDuVSQ6LlJFRt4hrigYk5bK3VwLmFCC0+tzObd7FfGZPQLvTh6HDT6bBMEZ/g4XM8TLrC/MknDxhBws+2UlzepvRUEgU2Eelp9mn/RjnOtcl1E/X5GRoB0zU8tg5oWQE8cep4SSizlTd/x0He4HXndLg35fMBm24/OwMsm7pW9AsRIl4uNTXakdWMVteY+5JqXglpy8UQJ3rBeM/dCkoNhwAsKDdAw8fDuqdSafGQyZu5+ZxQQEMk9vJx79BsbhaECDbVo9qafhaHrjKXHOKTRZIe8BnDqxuAZc78Qgz0aHwag==; 25:fNV5+nuFkzalQSknu2w97KrpxGAYTe+j4eCCy5lqT43ekc5HGh3a4yzjoMsUQrdCXStnw3oe4cwkqhOfeuV7xu9gOU/J7g4qoC0rPNTFoW3raVWaw5fcssIEDKMxU9pwnLV3GHvvE+Odi7Eco/3RKbMLQe6r2RdS2aJZX1PQdNO5WPYTvtaYbahIwySv3nrI3QX3wCHy2a/XFRFnCWB8S3VjnfmzW6HLjLikcA9ie04/AwvjjKm8PyCa5czuolI8yO/FdJQynsJZWyT0JHBukJ+rSAHX9gKH06oBSUKgi9FmbHU4xEkgRWWyuldHaMNK1GHruQsK375Z63WFCq1YIQ==; 31:Tko3bSuiGHUtnLzJKyxHLNUCGKMKQoGFzd+X1ITOl7FrfgYB0l5hwRneWHRzrwIO8XHtq1N4kUwIhrLeHw9sL74TELrRDxHWGOLBJPKiqDx1Zo2W4St9szvLO9ggaNSKCNvJ65FTjcl5ZI6fk2Uf+IF5uMqEmNa8ffxWHLlzVrywD09w7rHHO8/TPObcYHyJmj8A97d06+Sr4yKeIaecMH2/Mm/xLocOjMEj6IaZoFc= X-MS-TrafficTypeDiagnostic: BN6PR03MB2691: 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)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123561025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123559100)(20161123565025)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB2691; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB2691; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2691; 4:VvQ4xFbmBbw1cw6TWwY0ZmQgokSfhipiGWy3JKFpocwR2+XWECTmONtmvZ4a2JEOBR0AvqN3bPVec07OXCmvND4yXSgsnsLZj2SZHzVmugy+TGWRpsdeImnzMmSShdAnuNw7cDSdbl5T1QXoK0bbp0HG/P9bIB9vHAg7GDaPZd4HZlQ7cPhi/i0M+6RznbUH+W4K5lroQLOMx0ptqAgAhU4065qpI/n4YKjgnabmgIwmesymkMPH19cTGQyGpRzwzqviIeKZpqCVv5ft1Bjr22w4p+8vu5wDcRrnifwgNN0= X-Forefront-PRVS: 0452022BE1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2691; 23:icZpjlc1c8BTLzN4bV74pb/WcfsxTeAidiU79k3un?= =?us-ascii?Q?iDW20Fcc2ajh7hBlRiBh86vW1KjsP0/rDHgDWEhWN0u+MvL3KU8/OKKtPecW?= =?us-ascii?Q?LHopVFMKR4nTav0ay0NkOd13Ee+2MOBDiB3pwvOdwpSojc355gp1oZjCuofN?= =?us-ascii?Q?E5StWDlaDaqZOBzhFKNBcZ/jhEdM0yeAe66wdp2j8E3kaReiXRUeB5KchGpW?= =?us-ascii?Q?aYglGtXA1sK/KFNmW3tiX97A+PPg1OVgPHz+k5Hl8chm6jmk3M6BAvqh0xVZ?= =?us-ascii?Q?JwGYy+Zssm1lnfxWZ8wU99GSzJQismZQxyY//+qkf2Qvt199L3kDVvdV+qYG?= =?us-ascii?Q?ddBvcpuaxjmaRx0ke/lLrSN3kkSlckFNGlgYVE1ewznb3nQ4BaFz6OOm3M/7?= =?us-ascii?Q?ST+mSXu+JfGzh696ndXmNJ29a6Juz4C1V89bjVq8wA5oNyFc7OnKZCu/EWQv?= =?us-ascii?Q?QU4mXQYheW6Sh/+JGgq0YKyIvFYm6RAQ5NHNO7GXhPnmA6nCdQHmZgI2njJT?= =?us-ascii?Q?2UrOOtHLxMp3/QNmjDwAk6BZgnAZzo4E74/ra9wiC1ZozFRecX1aRDXsrLyY?= =?us-ascii?Q?7hbKzOwUliXsH9XGgIQrI/wfIxBBPojQJu61Rnz+AdTHFh+e6VLiBF2eSHhH?= =?us-ascii?Q?FN7i6AxaJVKMXblMGbOAkakIG+UUXyHAU/RpL1sCjvYwQQW7frLS8WgXSaAu?= =?us-ascii?Q?zh+Q7EH7Gb1N+/K2Kn4zt1/4EpnD+XAI/KCVWNpD/akodRZNz6Nz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v5U4lCAhRAoVLiZPNkhxE1q/h16VgZXq64xfLBDdLgnJ6GlcCglLJg+nIMprTMnY/CWmse59WZMyEwCBRxykslFbNk7MznSlJ3d6+AjoChI=; 7:oK3qfgkj9sd8y3wHvWZ7YMMBmE9l8xTtndYvw8tlybvlMDvPta798Ku7YtGzASzaITFzvAtEaUJnX2CsCq8/udlCjc+Bt6Y8xeELyvsDl4bFJ+4zhCb97LkR0goDtj0Yqqd0mVu4K+ehZNWhyzctqcsmzzwU0oMbpQuescD9htMf8Rokc97aHo9K7UxDaADbSCdEzP+MabqKqzE+OjCO7kbjKJ5lc0zn5kiLv3DuY/4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2017 04:46:18.8053 (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: BN6PR03MB2691 Subject: [edk2] [PATCH v3] 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) and not checking return status of NetLibDetectMedia(). NetLibDetectMedia() sets MediaPresent FLAG in case of success only and dont change flag on error. So, Media State will display as 'Media Present', in case of error also. Fix : Check return value of NetLibDetectMedia() Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Meenakshi Aggarwal Reviewed-by: Jaben Carsey --- 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