[RFC v2 01/13] test/fib6: zero-initialize config struct
Maxime Leroy
maxime at leroys.fr
Tue Nov 24 19:02:37 CET 2026
Initialize rte_fib6_conf with { 0 } to avoid using uninitialized
fields, aligned with how it is already done in test_fib.c.
This is needed because the struct will gain new optional fields
(tbl8_pool) that must default to NULL.
Signed-off-by: Maxime Leroy <maxime at leroys.fr>
---
app/test/test_fib6.c | 10 +++++-----
app/test/test_fib6_perf.c | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/test/test_fib6.c b/app/test/test_fib6.c
index 7204047941..b2364760a2 100644
--- a/app/test/test_fib6.c
+++ b/app/test/test_fib6.c
@@ -47,7 +47,7 @@ int32_t
test_create_invalid(void)
{
struct rte_fib6 *fib = NULL;
- struct rte_fib6_conf config;
+ struct rte_fib6_conf config = { 0 };
config.max_routes = MAX_ROUTES;
config.rib_ext_sz = 0;
@@ -106,7 +106,7 @@ int32_t
test_multiple_create(void)
{
struct rte_fib6 *fib = NULL;
- struct rte_fib6_conf config;
+ struct rte_fib6_conf config = { 0 };
int32_t i;
config.rib_ext_sz = 0;
@@ -133,7 +133,7 @@ int32_t
test_free_null(void)
{
struct rte_fib6 *fib = NULL;
- struct rte_fib6_conf config;
+ struct rte_fib6_conf config = { 0 };
config.max_routes = MAX_ROUTES;
config.rib_ext_sz = 0;
@@ -157,7 +157,7 @@ int32_t
test_add_del_invalid(void)
{
struct rte_fib6 *fib = NULL;
- struct rte_fib6_conf config;
+ struct rte_fib6_conf config = { 0 };
uint64_t nh = 100;
struct rte_ipv6_addr ip = RTE_IPV6_ADDR_UNSPEC;
int ret;
@@ -351,7 +351,7 @@ int32_t
test_lookup(void)
{
struct rte_fib6 *fib = NULL;
- struct rte_fib6_conf config;
+ struct rte_fib6_conf config = { 0 };
uint64_t def_nh = 100;
int ret;
diff --git a/app/test/test_fib6_perf.c b/app/test/test_fib6_perf.c
index 246bc2d509..d0fe64d1e6 100644
--- a/app/test/test_fib6_perf.c
+++ b/app/test/test_fib6_perf.c
@@ -68,7 +68,7 @@ static int
test_fib6_perf(void)
{
struct rte_fib6 *fib = NULL;
- struct rte_fib6_conf conf;
+ struct rte_fib6_conf conf = { 0 };
uint64_t begin, total_time;
unsigned int i, j;
uint64_t next_hop_add;
--
2.43.0
More information about the dev
mailing list