[PATCH] fib6: fix error code propagation on next hop update
Vladimir Medvedkin
vladimir.medvedkin at intel.com
Fri Jun 5 18:47:57 CEST 2026
When updating the next hop of an existing prefix, trie_modify() ignored
the return value of modify_dp() and always returned 0. An out-of-range
next hop is rejected by modify_dp() with -EINVAL but was reported to
the caller as success. Return the actual result.
Fixes: c3e12e0f0354 ("fib: add dataplane algorithm for IPv6")
Cc: stable at dpdk.org
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
---
lib/fib/trie.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/fib/trie.c b/lib/fib/trie.c
index fa5d9ec6b0..99272f45bd 100644
--- a/lib/fib/trie.c
+++ b/lib/fib/trie.c
@@ -600,7 +600,8 @@ trie_modify(struct rte_fib6 *fib, const struct rte_ipv6_addr *ip,
ret = modify_dp(dp, rib, &ip_masked, depth, next_hop);
if (ret == 0)
rte_rib6_set_nh(node, next_hop);
- return 0;
+
+ return ret;
}
if ((depth > 24) && (dp->rsvd_tbl8s + depth_diff > dp->number_tbl8s))
--
2.43.0
More information about the dev
mailing list