[v4,30/42] net/ixgbe: use rte strerror

Message ID 20241023082852.2780488-31-huangdengdui@huawei.com (mailing list archive)
State Changes Requested, archived
Delegated to: Thomas Monjalon
Headers
Series replace strerror |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

huangdengdui Oct. 23, 2024, 8:28 a.m. UTC
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 <huangdengdui@huawei.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 drivers/net/ixgbe/ixgbe_testpmd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_testpmd.c b/drivers/net/ixgbe/ixgbe_testpmd.c
index e0d161eafe..3c6d648844 100644
--- a/drivers/net/ixgbe/ixgbe_testpmd.c
+++ b/drivers/net/ixgbe/ixgbe_testpmd.c
@@ -141,7 +141,7 @@  cmd_set_vf_split_drop_en_parsed(void *parsed_result,
 		fprintf(stderr, "not supported on port %d\n", res->port_id);
 		break;
 	default:
-		fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+		fprintf(stderr, "programming error: (%s)\n", rte_strerror(-ret));
 	}
 }
 
@@ -243,7 +243,7 @@  cmd_set_macsec_offload_on_parsed(void *parsed_result,
 		fprintf(stderr, "not supported on port %d\n", port_id);
 		break;
 	default:
-		fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+		fprintf(stderr, "programming error: (%s)\n", rte_strerror(-ret));
 	}
 }
 
@@ -327,7 +327,7 @@  cmd_set_macsec_offload_off_parsed(void *parsed_result,
 		fprintf(stderr, "not supported on port %d\n", port_id);
 		break;
 	default:
-		fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+		fprintf(stderr, "programming error: (%s)\n", rte_strerror(-ret));
 	}
 }
 
@@ -402,7 +402,7 @@  cmd_set_macsec_sc_parsed(void *parsed_result,
 		fprintf(stderr, "not supported on port %d\n", res->port_id);
 		break;
 	default:
-		fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+		fprintf(stderr, "programming error: (%s)\n", rte_strerror(-ret));
 	}
 }
 
@@ -510,7 +510,7 @@  cmd_set_macsec_sa_parsed(void *parsed_result,
 		fprintf(stderr, "not supported on port %d\n", res->port_id);
 		break;
 	default:
-		fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+		fprintf(stderr, "programming error: (%s)\n", rte_strerror(-ret));
 	}
 }
 
@@ -599,7 +599,7 @@  cmd_tc_min_bw_parsed(void *parsed_result,
 		fprintf(stderr, "function not implemented\n");
 		break;
 	default:
-		fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+		fprintf(stderr, "programming error: (%s)\n", rte_strerror(-ret));
 	}
 }