From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B0BF741C32; Tue, 7 Feb 2023 18:00:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 988154021F; Tue, 7 Feb 2023 18:00:58 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 7F81B40151 for ; Tue, 7 Feb 2023 18:00:57 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id rm7-20020a17090b3ec700b0022c05558d22so15600215pjb.5 for ; Tue, 07 Feb 2023 09:00:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hj5eZAC9OM7yPnhqWaYEoYhRKUlhWc0DqcpfMiWqWrc=; b=obvu1s9MEkgQX3L3OrUj6vGh1/5x+/VMjmpWfaCFV5edkyx0UYlsy9XcDWiIxRRaHX BD4a8vg1E4r/qDpOPgi9+lVUfHaxif5nTwlbJ0UheBOs5+w7m3Nw7vsbiTtXgeP0F7ul dKjQN0pZH6GVwsLlT8qsL6gbxKlNnj04rfv+WoW5+zU+7ceA2vACnEG0kB2GxgqrU++o ADhU71bhFF6XjdRB9t4nyblFHkXNlQkL3Q429onwLioAW+UypM6MRd/I+KnF5iRgIMFb gVrLkNPxKu4hINvE/6cTouO4OFezoRc/EA+6chW1TM9dMHcDrCWzE7V/LfQt1YOB224s Uz/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hj5eZAC9OM7yPnhqWaYEoYhRKUlhWc0DqcpfMiWqWrc=; b=NTwzzfBSV5bMquGJBo00wSV1AAzfBqu/yfv5gii2M/y4tN0ErpeXENvD8zq23Eq25c aCM7QHT1HzvbVkXnIGApDzUz1sCLXUzNJdMQq1QbNcw954jpnd6SWP9chpwwhB2q5q75 G/ACBreQ7XdtjdCm0XcJafiq0htLSvPqcnvheCaiHy1wGeqBQzV6aqGmPm+UobgGt4wc tTbvpstEpM6v2+ewMQqTKnYbqnZgerbgW4IOonEJbk2wGDYNiXRXnyn+qWextnzE/ylo Ry2wN/Z2OY85essINrD+q60TQ0Y8GKcE31EVfHvKIWJOq97ejs0YElH5uPJbXLDjwCp2 N+Bg== X-Gm-Message-State: AO0yUKU2SBhOL1r5d9DML9tRC7cUDHmoMrZkxn1lZGcO/+wT0K77NEGk ZT0QJ3BasRwZXxbPx8Uro+XnqanXHTpBSVsF6sU= X-Google-Smtp-Source: AK7set8ru8fjxhqjmKBCLgwBh8/J22KtSm7fEn50UC9zFgKrhdSez05BQo5x/5HqQp2hy3yjU4n9FA== X-Received: by 2002:a05:6a20:b708:b0:c0:d8e1:8299 with SMTP id fg8-20020a056a20b70800b000c0d8e18299mr3410347pzb.14.1675789256212; Tue, 07 Feb 2023 09:00:56 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id z15-20020aa791cf000000b00590163e1762sm9403329pfa.200.2023.02.07.09.00.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 09:00:55 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH] app/dumpcap: don't pass negative value to strerror() on error Date: Tue, 7 Feb 2023 09:00:50 -0800 Message-Id: <20230207170050.1093917-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org If eth_stats_get fails (for example with -ENOTSUPP) then dumpcap would pass that to strerror which is incorrect. Fixes: 8744f84bb255 ("app/dumpcap: add statistics mode") Coverity issue: 383136 Signed-off-by: Stephen Hemminger --- app/dumpcap/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index 904eb5a7d7d9..64294bbfb3e6 100644 --- a/app/dumpcap/main.c +++ b/app/dumpcap/main.c @@ -500,7 +500,7 @@ static void statistics_loop(void) if (r < 0) { fprintf(stderr, "stats_get for port %u failed: %d (%s)\n", - p, r, strerror(r)); + p, r, strerror(-r)); return; } -- 2.39.1