fib: fix adding a default route
PATCH 1/1 fib: fix adding a default route
Fixed an issue that occurs when
adding a default route as the first route.
Bugzilla ID: 1160
Fixes 7dc7868b200d ("fib: add DIR24-8 dataplane algorithm")
Signed-off-by Vladimir Medvedkin <[email protected]>
--- lib/fib/dir24_8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/fib/dir24_8.c +1 -1
@@ -390,7 +390,7 @@ modify_fib(struct dir24_8_tbl *dp, struct rte_rib *rib, uint32_t ip, (uint32_t )(1ULL << (32 - tmp_depth)); }else { redge = ip + (uint32_t )(1ULL << (32 - depth)); -if (ledge == redge) +if ((ledge == redge) && (ledge !=0 ))break ; ret =install_to_fib (dp, ledge, redge, next_hop);
Signature · 1 line
2.25.1
lib/fib/dir24_8.c modify_fib(struct dir24_8_tbl *dp, struct rte_rib *rib, uint32_t ip, · line 393
Quoted 3 lines · On Fri, 30 Jun 2023 17:10:35 +0000 Vladimir Medvedkin…
lib/fib/dir24_8.c +1
-1redge = ip + (uint32_t )(1ULL << (32 - depth)); -if (ledge == redge) +if ((ledge == redge) && (ledge !=0 ))
Extra parenthesis are not necessary here.
PATCH 1/1 fib: fix adding a default route
In reply to Vladimir MedvedkinFixed an issue that occurs when
adding a default route as the first route.
Bugzilla ID: 1160
Fixes 7dc7868b200d ("fib: add DIR24-8 dataplane algorithm")
Signed-off-by Vladimir Medvedkin <[email protected]>
---
v2:
- remove unnecessary parenthesis
--- lib/fib/dir24_8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/fib/dir24_8.c +1 -1
@@ -390,7 +390,7 @@ modify_fib(struct dir24_8_tbl *dp, struct rte_rib *rib, uint32_t ip, (uint32_t )(1ULL << (32 - tmp_depth)); }else { redge = ip + (uint32_t )(1ULL << (32 - depth)); -if (ledge == redge) +if (ledge == redge && ledge !=0 )break ; ret =install_to_fib (dp, ledge, redge, next_hop);
Signature · 1 line
2.25.1
Thomas Monjalon
Applied03/07/2023 17:43, Vladimir Medvedkin:
Quoted 8 lines
Fixed an issue that occurs when
adding a default route as the first route.Bugzilla ID: 1160
Fixes 7dc7868b200d ("fib: add DIR24-8 dataplane algorithm")Signed-off-by Vladimir Medvedkin <[email protected]>
Applied, thanks.