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 4B4EE43325; Tue, 14 Nov 2023 09:28:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 77BB040DD8; Tue, 14 Nov 2023 09:26:16 +0100 (CET) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 6379740648 for ; Tue, 14 Nov 2023 09:25:45 +0100 (CET) Received: from dggpeml500011.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4STzlT2YWVzMmtL; Tue, 14 Nov 2023 16:21:09 +0800 (CST) Received: from localhost.huawei.com (10.50.165.33) by dggpeml500011.china.huawei.com (7.185.36.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 14 Nov 2023 16:25:43 +0800 From: Dengdui Huang To: CC: , , , , Subject: [PATCH 24/43] net/bonding: use rte strerror Date: Tue, 14 Nov 2023 16:25:20 +0800 Message-ID: <20231114082539.1858594-25-huangdengdui@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20231114082539.1858594-1-huangdengdui@huawei.com> References: <20231114082539.1858594-1-huangdengdui@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500011.china.huawei.com (7.185.36.84) X-CFilter-Loop: Reflected 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 The function strerror() is insecure in a multi-thread environment. This patch uses rte_strerror() to replace it. Cc: stable@dpdk.org Signed-off-by: Dengdui Huang Acked-by: Chengwen Feng --- drivers/net/bonding/bonding_testpmd.c | 4 ++-- drivers/net/bonding/rte_eth_bond_api.c | 2 +- drivers/net/bonding/rte_eth_bond_flow.c | 4 ++-- drivers/net/bonding/rte_eth_bond_pmd.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/bonding/bonding_testpmd.c b/drivers/net/bonding/bonding_testpmd.c index 8fcd6cadd0..111f9de0e7 100644 --- a/drivers/net/bonding/bonding_testpmd.c +++ b/drivers/net/bonding/bonding_testpmd.c @@ -551,7 +551,7 @@ static void cmd_set_bond_mac_addr_parsed(void *parsed_result, /* check the return value and print it if is < 0 */ if (ret < 0) fprintf(stderr, "set_bond_mac_addr error: (%s)\n", - strerror(-ret)); + rte_strerror(-ret)); } static cmdline_parse_token_string_t cmd_set_bond_mac_addr_set = @@ -604,7 +604,7 @@ static void cmd_set_bond_mon_period_parsed(void *parsed_result, /* check the return value and print it if is < 0 */ if (ret < 0) fprintf(stderr, "set_bond_mac_addr error: (%s)\n", - strerror(-ret)); + rte_strerror(-ret)); } static cmdline_parse_token_string_t cmd_set_bond_mon_period_set = diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index 99e496556a..1d20d421bc 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -483,7 +483,7 @@ __eth_bond_member_add_lock_free(uint16_t bonding_port_id, uint16_t member_port_i if (ret != 0) { RTE_BOND_LOG(ERR, "%s: Error during getting device (port %u) info: %s\n", - __func__, member_port_id, strerror(-ret)); + __func__, member_port_id, rte_strerror(-ret)); return ret; } diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c index 71a91675f7..b7e966f393 100644 --- a/drivers/net/bonding/rte_eth_bond_flow.c +++ b/drivers/net/bonding/rte_eth_bond_flow.c @@ -31,7 +31,7 @@ bond_flow_alloc(int numa_node, const struct rte_flow_attr *attr, if (ret < 0) { RTE_BOND_LOG(ERR, "Unable to process flow rule (%s): %s", error.message ? error.message : "unspecified", - strerror(rte_errno)); + rte_strerror(rte_errno)); return NULL; } flow = rte_zmalloc_socket(NULL, offsetof(struct rte_flow, rule) + ret, @@ -45,7 +45,7 @@ bond_flow_alloc(int numa_node, const struct rte_flow_attr *attr, if (ret < 0) { RTE_BOND_LOG(ERR, "Failed to copy flow rule (%s): %s", error.message ? error.message : "unspecified", - strerror(rte_errno)); + rte_strerror(rte_errno)); rte_free(flow); return NULL; } diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index c40d18d128..fdf152a51a 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -192,7 +192,7 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, if (ret != 0) { RTE_BOND_LOG(ERR, "%s: Error during getting device (port %u) info: %s\n", - __func__, member_port, strerror(-ret)); + __func__, member_port, rte_strerror(-ret)); return ret; } @@ -223,7 +223,7 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) { RTE_BOND_LOG(ERR, "%s: Error during getting device (port %u) info: %s\n", __func__, bond_dev->data->port_id, - strerror(-ret)); + rte_strerror(-ret)); return ret; } @@ -2292,7 +2292,7 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) "%s: Error during getting device (port %u) info: %s\n", __func__, member.port_id, - strerror(-ret)); + rte_strerror(-ret)); return ret; } -- 2.33.0