When the nexthop of an existing route is changed, the error returned by
the dataplane update was discarded and success was reported even if the
DIR24_8 table could not be updated.

Return the actual status, as the IPv6 TRIE algorithm does.

Fixes: 7dc7868b200d ("fib: add DIR24-8 dataplane algorithm")
Cc: [email protected]

Signed-off-by: Vladimir Medvedkin <[email protected]>
---
 lib/fib/dir24_8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/fib/dir24_8.c b/lib/fib/dir24_8.c
index 489d2ef427..bb7975eca1 100644
--- a/lib/fib/dir24_8.c
+++ b/lib/fib/dir24_8.c
@@ -498,7 +498,7 @@ dir24_8_modify(struct rte_fib *fib, uint32_t ip, uint8_t 
depth,
                        ret = modify_fib(dp, rib, ip, depth, next_hop);
                        if (ret == 0)
                                rte_rib_set_nh(node, next_hop);
-                       return 0;
+                       return ret;
                }
                if (depth > 24) {
                        tmp = rte_rib_get_nxt(rib, ip, 24, NULL,
-- 
2.43.0

Reply via email to